torch expand
生活随笔
收集整理的這篇文章主要介紹了
torch expand
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
expand 就是對那個維度為一的進行擴張
import torcha=torch.tensor([[3.0000, 3.0000],[3.0000, 4.0000],[3.6000, 3.0000],[3.5000, 3.0000]])a1=a.reshape([a.shape[0],a.shape[1] ,1])#a1.shape==[4, 2, 1]#對那個維度為一的進行擴張 a2=a1.expand([4,2,9])print(a2.shape)#torch.Size([4, 2, 9])總結
以上是生活随笔為你收集整理的torch expand的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: torch 的 unsqueeze用法
- 下一篇: argsort()