评价此页

torch.atanh#

torch.atanh(input: Tensor, *, out: Optional[Tensor]) Tensor#

返回一个新张量,其中包含input元素的双曲反正切。

注意

反双曲正切函数的定义域为 (-1, 1),在此范围之外的值将被映射为 NaN,但 1-1 这两个值除外,它们将被映射为 +/-INF

outi=tanh1(inputi)\text{out}_{i} = \tanh^{-1}(\text{input}_{i})
参数

input (Tensor) – 输入张量。

关键字参数

out (Tensor, optional) – 输出张量。

示例

>>> a = torch.randn(4).uniform_(-1, 1)
>>> a
tensor([ -0.9385, 0.2968, -0.8591, -0.1871 ])
>>> torch.atanh(a)
tensor([ -1.7253, 0.3060, -1.2899, -0.1893 ])