PyTorch torch.acos Function
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
)
(
result
)
The output is:
tensor([3.1416, 2.0944, 1.5708, 1.0472, 0.0000])