Rate this Page

torch.Tensor.reshape#

Tensor.reshape(*shape)Tensor#

Returns a tensor with the same data and number of elements asselfbut with the specified shape. This method returns a view ifshape iscompatible with the current shape. Seetorch.Tensor.view() on when it ispossible to return a view.

Seetorch.reshape()

Parameters

shape (tuple ofints orint...) – the desired shape