PyTorch torch.acos Function


Pytorch torch 参考手册Pytorch torch Reference Manual

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

Function Definition

torch.acos(input, out=None)

Usage Example

Example

import torch

# Create tensor
x = torch.tensor([-1.0, -0.5, 0.0, 0.5, 1.0])

# Compute arccosine
result = torch.acos(x)
print(result)

The output result is:

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

Pytorch torch 参考手册Pytorch torch Reference Manual

Other Extensions