PyTorch torch.arctan Function
Pytorch torch Reference Manual
torch.arctanis a function in PyTorch used to compute the element-wise arctangent, and has the sametorch.atanfunctionality.
Function Definition
torch.arctan(input, out=None)
Usage Examples
Example
import torch
# Create tensor
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])
# Compute arctangent
result = torch.arctan(x)
print(result)
# Create tensor
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])
# Compute arctangent
result = torch.arctan(x)
print(result)
The output is:
tensor([-0.7854, -0.4636, 0.0000, 0.4636, 0.7854])
Other Extensions