import torch
import numpy as np
import math
data = [-0.9999,-0.5, -0.1, 0.8,0.9]
tensor = torch.FloatTensor(data) # 转换成32位浮点 tensor# sin 三角函数 sin
print('\nsin',torch.log(math.pi- torch.asin(tensor)),'\nnumpy: ', math.pi- np.arcsin(data), # [-0.84147098 -0.90929743 0.84147098 0.90929743]'\ntorch: ', torch.sin( math.pi- torch.asin(tensor)) # [-0.8415 -0.9093 0.8415 0.9093]
)