快捷方式

torch.Tensor.reshape

Tensor.reshape(*shape) Tensor

返回一個與 self 具有相同資料和元素數量,但形狀為指定形狀的 tensor。如果 shape 與當前形狀相容,此方法將返回一個檢視。請參閱 torch.Tensor.view(),瞭解何時可以返回檢視。

請參閱 torch.reshape()

引數

shape (ints 的 tupleint...) – 期望的形狀

文件

查閱 PyTorch 的全面開發者文件

檢視文件

教程

獲取針對初學者和高階開發者的深度教程

檢視教程

資源

查詢開發資源並獲得問題解答

檢視資源