Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.arctan function

PyTorch torch.arctan function


PyTorch torch reference manual PyTorch torch reference manual

torch.arctan is a function in PyTorch used to compute the element-wise arctangent, the same as torch.atan in functionality.

Function definition

torch.arctan(input, out=None)


Usage examples

Example

import

torch

Creating tensors

x

=

torch.

tensor

(

[

1.0

,

0.5

,

0.0

,

0.5

,

1.0

]

)

Compute the arctangent

result

=

torch.

arctan

(

x

)

print

(

result

)

The output is:

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


PyTorch torch reference manual PyTorch torch reference manual