PyTorch torch.arctanh function
PyTorch torch reference manual
torch.arctanh is a function in PyTorch used to compute the element-wise inverse hyperbolic tangent, the same as torch.atanh in functionality.
Function definition
torch.arctanh(input, out=None)
Usage examples
Example
import
torch
Create a tensor (values must be between -1 and 1)
x
=
torch.
tensor
(
[
0.5
,
0.25
,
0.0
,
0.25
,
0.5
]
)
Compute the inverse hyperbolic tangent
result
=
torch.
arctanh
(
x
)
(
result
)
The output is:
tensor([-0.5493, -0.2554, 0.0000, 0.2554, 0.5493])