view

abstract fun Tensor<T>.view(shape: IntArray): Tensor<T>

Returns a new tensor with the same data as the self tensor but of a different shape. The returned tensor shares the same data and must have the same number of elements, but may have a different size For more information: https://pytorch.org/docs/stable/tensor_view.html

Return

tensor with new shape

Parameters

shape

the desired size

Sources

Link copied to clipboard