## Usage Example ## Example import torch # Create tensor (values must be between -1 and 1) x = torch.tensor([-0.5, -0.25, 0.0, 0.25, 0.5]) # Compute inverse hyperbolic tangent result = torch.atanh(x) print(result) Output result: tensor([-0.5493, -0.2554, 0.0000, 0.2554, 0.5493])
Pytorch Torch Atanh
# PyTorch torch.atanh Function
PyTorch torch Reference
`torch.atanh` is a PyTorch function used to compute the element-wise inverse hyperbolic tangent.
### Function Definition
torch.atanh(input, out=None)
## Usage Example ## Example import torch # Create tensor (values must be between -1 and 1) x = torch.tensor([-0.5, -0.25, 0.0, 0.25, 0.5]) # Compute inverse hyperbolic tangent result = torch.atanh(x) print(result) Output result: tensor([-0.5493, -0.2554, 0.0000, 0.2554, 0.5493])
PyTorch torch Reference
## Usage Example ## Example import torch # Create tensor (values must be between -1 and 1) x = torch.tensor([-0.5, -0.25, 0.0, 0.25, 0.5]) # Compute inverse hyperbolic tangent result = torch.atanh(x) print(result) Output result: tensor([-0.5493, -0.2554, 0.0000, 0.2554, 0.5493])
YouTip