切块操作split and chunk

2022-06-20  本文已影响0人  菌子甚毒

https://blog.csdn.net/foneone/article/details/103875250

t = torch.rand(10,3)
t1 = t.split(2,dim=0) # tuple (5,) t1[0]:torch.Size([2, 3])
t2 = t.chunk(2,dim=0)   # tuple (2,) t2[0]:torch.Size([5, 3])
上一篇 下一篇

猜你喜欢

热点阅读