On this page
torch.Tensor.reshape
Tensor.reshape(*shape) → Tensor
-
Returns a tensor with the same data and number of elements as
self
but with the specified shape. This method returns a view ifshape
is compatible with the current shape. Seetorch.Tensor.view()
on when it is possible to return a view.See
torch.reshape()
© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.Tensor.reshape.html