.asinh()
Published Mar 28, 2025
Contribute to Docs
The PyTorch method .asinh()
returns the inverse hyperbolic sine of each element in a given tensor. It is useful for mathematical and scientific computations involving hyperbolic functions.
Syntax
torch.asinh(input, *, out=None) → Tensor
Parameters
input
: A tensor containing real or complex values of any dimension.out
(Optional): The output tensor to store the result. If not specified, a new tensor is returned.
Returns
A new tensor containing the inverse hyperbolic sine of each element in the input tensor.
Example
The following example demonstrates how to use .asinh()
to compute the inverse hyperbolic sine for the real-valued 1D tensor:
import torchinput_tensor = torch.tensor([0.125, 0.25, 0.5, 0.75])output_tensor = torch.asinh(input_tensor)print("Input Tensor:")print(input_tensor)print("\nOutput Tensor:")print(output_tensor)
This example outputs:
Input Tensor:tensor([0.1250, 0.2500, 0.5000, 0.7500])Output Tensor:tensor([0.1253, 0.2526, 0.5211, 0.8223])
The values in output_tensor
represents the inverse hyperbolic sine of the corresponding values in input_tensor
.
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn PyTorch on Codecademy
- Career path
Data Scientist: Machine Learning Specialist
Machine Learning Data Scientists solve problems at scale, make predictions, find patterns, and more! They use Python, SQL, and algorithms.Includes 27 CoursesWith Professional CertificationBeginner Friendly95 hours - Free course
Intro to PyTorch and Neural Networks
Learn how to use PyTorch to build, train, and test artificial neural networks in this course.Intermediate3 hours