此文章记录我在看论文代码中查阅的一些函数,不断更新。
1. torch.exp(input : tensor) > tensor
torch.exp是PyTorch库中的一个函数,它的作用是对输入的张量进行按元素指数运算。
返回和传入tensor一样维度的tensor。
2.torch.clamp(input : tensor,min,max,out=None)>tensor
将输入的张量限制在[min,max]之间,返回一个新的同等维度张量。
3.torch.cat(input : tensor,dim=) > tensor
在输入的多个tensor在dim输入的维度进行拼接.。
a=[tensor1.shape=2,3,tensor2.shape=2,3]
torch.cat(a,dim=0).shape=4,3
torch.cat(a,dim=0).shape=2,6
待后续补充