PyTorch torch.arccos function
PyTorch torch reference manual
torch.arccos is a function in PyTorch used to compute the element-wise arccosine, the same as torch.acos in functionality.
Function definition
torch.arccos(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.
arccos
(
x
)
(
result
)
The output is:
tensor([3.1416, 2.0944, 1.5708, 1.0472, 0.0000])