torch.Tensor.reshape¶
- Tensor.reshape(*shape) Tensor ¶
傳回一個 Tensor,其資料和元素數量與
self
相同,但具有指定的形狀。 如果shape
與目前的形狀相容,則此方法會傳回視圖。 請參閱torch.Tensor.view()
,瞭解何時可以傳回視圖。請參閱
torch.reshape()
傳回一個 Tensor,其資料和元素數量與 self
相同,但具有指定的形狀。 如果 shape
與目前的形狀相容,則此方法會傳回視圖。 請參閱 torch.Tensor.view()
,瞭解何時可以傳回視圖。
請參閱 torch.reshape()