![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
看,这有一只小强~
办法总比困难多。
展开
-
torch.nn.parameter()
torch.nn.parameter()转载 2019-12-25 13:54:28 · 381 阅读 · 0 评论 -
pytorch矩阵在新维度上拼接torch.stack
a = torch.tensor([[1,2,3], [4,5,6]]) b = torch.tensor([[11,22,33], [44,55,66]]) a.size = b.size = (2,3) torch.stack([a,b],dim = 0)原创 2019-12-17 10:14:08 · 2185 阅读 · 0 评论 -
python中reshape和torch.view
reshape: x = np.array([[[1,2,3],[4,5,6]], [[7,8,9],[10,11,12]]]) print(x.reshape(2,6)) 输出 [[ 1 2 3 4 5 6] [ 7 8 9 10 11 12]] torch.view: # print(4&3) x = torch.tensor([[[1,2,3],[4,5...原创 2019-12-25 10:20:12 · 1243 阅读 · 1 评论