![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
torch
文章平均质量分 81
CharlesLC的博客
求关注,求关注,求关注,haha
展开
-
pytorch 数据类型 和 numpy 数据 相互转化
torch 与 numpy 数据转化原创 2022-07-25 17:18:23 · 2448 阅读 · 0 评论 -
torch中乘法整理,*&torch.mul()&torch.mv()&torch.mm()&torch.dot()&@&torch.mutmal()
位置乘数乘torch.mv()矩阵向量乘法torch.mm()矩阵乘法torch.dot()点乘积@操作。原创 2022-07-25 17:16:30 · 4354 阅读 · 0 评论 -
pytorch中几个难理解的方法整理--gather&squeeze&unsqueeze
gatherpytorch中gather源码形式:torch.gather(input, dim, index, *, sparse_grad = False, out = None)然后在pytorch官方文档中,写了这样的一个例子,这个例子是三维的out[i][j][k] = input[index[i][j][k]][j][k] # if dim == 0out[i][j][k] = input[i][index[i][j][k]][k] # if dim == 1out[i][j][k原创 2022-03-10 10:20:19 · 2005 阅读 · 1 评论