pytorch / 2 / generated / torch.nn.functional.tanh.html

torch.nn.functional.tanh

torch.nn.functional.tanh(input) → Tensor [source]

Applies element-wise, Tanh ( x ) = tanh ( x ) = exp ( x ) exp ( x ) exp ( x ) + exp ( x ) \text{Tanh}(x) = \tanh(x) = \frac{\exp(x) - \exp(-x)}{\exp(x) + \exp(-x)}

See Tanh for more details.

© 2024, PyTorch Contributors
PyTorch has a BSD-style license, as found in the LICENSE file.
https://pytorch.org/docs/2.1/generated/torch.nn.functional.tanh.html