PyTorch · Function
torch.reshape
torch.reshape changes a tensor to a requested shape while keeping its data and number of elements. It may return a view or a copy, so code should not depend on which one occurs.
Last updated
Syntax
torch.reshape(input, shape) → TensorIn-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
torch.Tensor.view()torch.Tensor.reshape()