contiguous method

Tensor<T> contiguous()

Returns a contiguous copy of this tensor, if the tensor is already contiguous return itself.

Implementation

Tensor<T> contiguous() => layout.isContiguous
    ? this
    : Tensor.internal(
        type: type,
        layout: Layout(shape: layout.shape),
        data: type.copyList(values));