markdown折叠代码
<details style='background-color:#f9f2f4'>
<summary><font color='#c7254e' size='3px'> view code</font></summary>
你的代码
</details>
view code
c=torch.rand(3,32,8)
aa,bb=c.split([1,2],dim=0)
print(aa.shape,bb.shape) #torch.Size([1, 32, 8]) torch.Size([2, 32, 8])
aa,bb,cc=c.split([1,1,1],dim=0) #或者写成aa,bb,cc=c.split(1,dim=0)
print(aa.shape,bb.shape,cc.shape) #torch.Size([1, 32, 8]) torch.Size([1, 32, 8]) torch.Size([1, 32, 8])