PyTorch is an open-source machine learning library developed by Facebook. It is used for deep neural network and natural language processing purposes.
torch.atan() provides support for the inverse tangent function in PyTorch. It gives the output in radian form. The input type is tensor and if the input contains more than one element, element-wise inverse tangent is computed.
Syntax: torch.atan(x, out=None)
x: Input tensor
name (optional): Output tensor
Return type: A tensor with the same type as that of x.
tensor([ 1.0000, -0.5000, 3.4000, 0.2000, 0.0000, -2.0000]) tensor([ 0.7854, -0.4636, 1.2847, 0.1974, 0.0000, -1.1071])
Code #2: Visualization
tensor([-1.3734, -1.3416, -1.2978, -1.2341, -1.1342, -0.9601, -0.6202, 0.0000, 0.6202, 0.9601, 1.1342, 1.2341, 1.2978, 1.3416, 1.3734])
- Python | PyTorch cos() method
- Python | PyTorch tan() method
- Python | PyTorch sin() method
- Python | PyTorch asin() method
- Python | PyTorch tanh() method
- Python | PyTorch cosh() method
- Python | PyTorch acos() method
- Python | PyTorch sinh() method
- Python | sympy.atan() method
- Python | Tensorflow atan() method
- Linear Regression using PyTorch
- Deep Learning with PyTorch | An Introduction
- Identifying handwritten digits using Logistic Regression in PyTorch
- class method vs static method in Python
- Python | set() method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.