PyTorch torch.atan Function


Pytorch torch 参考手册Pytorch torch Reference Manual

torch.atanIt is a function in PyTorch used to compute the element-wise arctangent.

Function Definition

torch.atan(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 arctangent
result = torch.atan(x)
print(result)

The output result is:

tensor([-0.7854, -0.4636,  0.0000,  0.4636,  0.7854])

Pytorch torch 参考手册Pytorch torch Reference Manual

Other Extensions