reshape¶
Documentation¶
-
class
treetensor.torch.
Tensor
(data, *args, constraint=None, **kwargs)[source]¶
Torch Version Related
This documentation is based on torch.Tensor.reshape in torch v1.9.0+cu102. Its arguments’ arrangements depend on the version of pytorch you installed.
If some arguments listed here are not working properly, please check your pytorch’s version with the following command and find its documentation.
1 | python -c 'import torch;print(torch.__version__)' |
The arguments and keyword arguments supported in torch v1.9.0+cu102 is listed below.
Description From Torch v1.9.0+cu102¶
-
class
torch.
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()
- Args:
shape (tuple of ints or int…): the desired shape
-