Torch中和np.reshape相同功能的函数

>>> import torch
>>> t = torch.ones((2, 3, 4))
>>> t.size()
torch.Size([2, 3, 4])
>>> t.view(-1, 12).size()
torch.Size([2, 12])
发布了38 篇原创文章 · 获赞 98 · 访问量 36万+

猜你喜欢

转载自blog.csdn.net/xijuezhu8128/article/details/86590493
今日推荐