(Tensor) the tensor to be reshaped
(tuple of ints) the new shape
Returns a tensor with the same data and number of elements as
but with the specified shape. When possible, the returned tensor will be a view
input. Otherwise, it will be a copy. Contiguous inputs and inputs
with compatible strides can be reshaped without copying, but you should not
depend on the copying vs. viewing behavior.
torch_Tensor.view on when it is possible to return a view.
A single dimension may be -1, in which case it's inferred from the remaining
dimensions and the number of elements in
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.