快捷方式

torch.Tensor.reshape_as

Tensor.reshape_as(other) Tensor

返回與 other 形狀相同的張量。self.reshape_as(other) 等價於 self.reshape(other.sizes())。如果 other.sizes() 與當前形狀相容,則此方法返回一個檢視。請參閱 torch.Tensor.view() 瞭解何時可以返回檢視。

有關 reshape 的更多資訊,請參閱 reshape()

引數

other (torch.Tensor) – 結果張量與 other 具有相同的形狀。

文件

查閱 PyTorch 全面開發者文件

檢視文件

教程

獲取面向初學者和高階開發者的深入教程

檢視教程

資源

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

檢視資源