![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Pytorch小知识
文章平均质量分 97
十小大
一个致力于编程自由的小学生,主要研究内容为计算机视觉、图像拼接、超分辨率重建、GUI界面可视化、图像处理;编程语言为Python、Matlab等
展开
-
【Pytorch小知识】torch.roll()函数的用法及在Swin Transformer中的应用(详细易懂)
文章目录torch.roll()的官方文档函数形式及参数说明举个例子torch.roll()的应用具体步骤torch.roll()的官方文档函数形式及参数说明函数形式:torch.roll(input,shifts,dims=None)参数解释:input:输入张量shifts:滚动的方向和长度,若为正,则向下滚动;若为负,则向上滚动。可是一个整数也可以是一个元组。(具体见下面例子)dims:张量按什么维度滚动。以二维为例,0就是按行上下或者下上(shifts为负)滚动;1就是左右或者右原创 2021-05-27 15:05:01 · 198935 阅读 · 6 评论 -
【Pytorch小知识】torch.gather()函数的用法及在Focal Loss中的应用(详细易懂)
文章目录官方文档中torch.gather的用法torch.gather应用总结官方文档中torch.gather的用法torch.gather(input, dim, index, out=None) → Tensor Gathers values along an axis specified by dim. For a 3-D tensor the output is specified by: out[i][j][k] = input[index[i][j][k]原创 2021-05-25 12:11:38 · 197810 阅读 · 0 评论