megengine.functional.atanh¶
- atanh(x)[source]¶
Element-wise \(\tanh^{-1}(x)\) function.
Calculates the inverse hyperbolic tangent for each element \(x_i\) of the input tensor \(x\).
This function has domain
[-1, +1]
and codomain[-infinity, +infinity]
.Special cases
If \(x_i\) is
NaN
, the result isNaN
.If \(x_i\) is less than
-1
, the result isNaN
.If \(x_i\) is greater than
1
, the result isNan
.If \(x_i\) is
+1
, the result is+infinity
.If \(x_i\) is
-1
, the result is-infinity
.If \(x_i\) is
+0
, the result is+0
.If \(x_i\) is
-0
, the result is-0
.
- Parameters
x – input tensor whose elements each represent the area of a hyperbolic sector. Should have a floating-point data type.
- Returns
a tensor containing the inverse hyperbolic tangent of each element in \(x\). The returned tensor must have a floating-point data type determined by Type promotion rules.
Examples
>>> F.atanh(0) Tensor(0.0, device=xpux:0)
Element-wise inverse hyperbolic tangent:
>>> x = Tensor([0, 0.5, -0.5]) >>> F.atanh(x) Tensor([ 0. 0.5493 -0.5493], device=xpux:0)