1. 程式人生 > 其它 >shape | reshape | view | resize | resize_ | permute 的區別_CodingPark程式設計公園

shape | reshape | view | resize | resize_ | permute 的區別_CodingPark程式設計公園

技術標籤:基本功python深度學習機器學習

前言

首先提醒一下:只有Tensor型別的資料才可以進行 reshape()等資料操作

普通 list 資料
在這裡插入圖片描述

Tensor 資料
在這裡插入圖片描述


reshape和view之間的區別

  • 相同點:都是可以改變tensor的形狀

  • 不同點:tensor不連續,view( )