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

PyTorch torch.acos Function

PyTorch torch.acos Function


PyTorch torch reference manual PyTorch torch reference manual

torch.acos is a function in PyTorch used to compute the element-wise arccosine.

Function definition



torch.acos(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 arccosine

result

=

torch.

acos

(

x

)

print

(

result

)

The output is:



tensor([3.1416, 2.0944, 1.5708, 1.0472, 0.0000])


PyTorch torch reference manual PyTorch torch reference manual