view
Tensor reshaping as a module wrapping Tensor.view.
Classes:
-
ViewβReturns a new view of the tensor with the same data.
View [source] ΒΆ
Bases: Module
Returns a new view of the tensor with the same data. This is a wrapper around the torch.view function.
Note
This will not create a copy of the tensor and is generally more efficient than a torch.reshape call. However, it requires the input tensor to have a contiguous memory layout.
Parameters:
-
*shape(int, default:()) βThe new shape of the tensor.