知识趣记-torch算术运算
- 加减乘除
torch.add(input, alpha=1, other, out=None)
torch.addcdiv(tensor, value=1, tensor1, tensor2, out=None)
torch.addcmul(tensor, value=1, tensor1, tensor2, out=None)
torch.sub(input, other, out=None)
torch.mul(input, other, out=None)
torch.div(input, other, out=None)
- 对数,指数,幂函数
torch.log(input, out=None) ——以e为底
torch.log10(input, out=None)
torch.log2(input, out=None)
torch.exp(input, out=None)
torch.pow(input, exponent, out=None)
- 三角函数
torch.acos(input, out=None)
torch.cosh(input, out=None)
torch.cos(input, out=None)
torch.asin(input, out=None)
torch.sinh(input, out=None)
torch.sin(input, out=None)
torch.atan(input, out=None)
torch.tanh(input, out=None)
torch.tan(input, out=None)
torch.atan2(input, other, out=None)
- 绝对值
torch.abs(input, out=None)