PyTorch torch.arcsinh 函数
torch.arcsinh 是 PyTorch 中用于计算逐元素反双曲正弦(inverse hyperbolic sine)的函数,与 torch.asinh 功能相同。
函数定义
torch.arcsinh(input, out=None)
使用示例
实例
import torch
# 创建张量
x = torch.tensor([-3.0, -1.0, 0.0, 1.0, 3.0])
# 计算反双曲正弦
result = torch.arcsinh(x)
print(result)
# 创建张量
x = torch.tensor([-3.0, -1.0, 0.0, 1.0, 3.0])
# 计算反双曲正弦
result = torch.arcsinh(x)
print(result)
输出结果为:
tensor([-1.8184, -0.8814, 0.0000, 0.8814, 1.8184])

Pytorch torch 参考手册