![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pytorch
Stone_3.1415926
NAS一枚小新
展开
-
pytorch具体演示代码
import torcht = torch.tensor([[1,2,3],[4,5,6]])# torch.tensor()函数将列表转换为张量>>> print(t)tensor([[1, 2, 3], [4, 5, 6]])t.size() #返回张量的大小>>> print(t.size())torch.Size([2, ...原创 2020-01-13 21:24:56 · 291 阅读 · 0 评论 -
pytorch语法知识从零开始
import torcht = torch.tensor([[1,2,3],[4,5,6]])# torch.tensor()函数将列表转换为张量>>> print(t)tensor([[1, 2, 3], [4, 5, 6]])它的一些操作:(以上面代码中的t为例进行演示)t.size() #返回张量的大小t.reshape(3,2) #重新组织...原创 2020-01-13 21:16:01 · 243 阅读 · 0 评论