
torch
fxolivia
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
pytorch之gather()
>>>import torch >>> >>>a = torch.Tensor([[1,2,3],[4,5,6]]) >>>a tensor([[1., 2., 3.], [4., 5., 6.]]) >>>b = torch.gather(a,1,torch.LongTensor([[1,...原创 2020-03-02 13:45:21 · 166 阅读 · 0 评论 -
Torch & Gym
Torch 创建初始化零矩阵且数据类型为long: import torch x=torch.zeros(3, 2, dtype=torch.long) print(x) print (x.size()) 输出: tensor([[0, 0], [0, 0], [0, 0]]) torch.Size([3,2]) 直接从数据构造张量 x = t...原创 2020-02-24 19:25:57 · 491 阅读 · 0 评论