PyTorch torch.arcsin function
Pytorch torch Reference Manual
torch.arcsinis a function in PyTorch used to compute the element-wise arcsine, andtorch.asinhas the same functionality.
Function Definition
torch.arcsin(input, out=None)
Usage Example
Example
import torch
# Create a tensor
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])
# Compute the arcsine
result = torch.arcsin(x)
print(result)
# Create a tensor
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])
# Compute the arcsine
result = torch.arcsin(x)
print(result)
The output result is:
tensor([-1.5708, -0.5236, 0.0000, 0.5236, 1.5708])
Other Extensions