torch.nn.functional.tanh¶ torch.nn.functional.tanh(input) → Tensor[source]¶ 应用逐元素的 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)}Tanh(x)=tanh(x)=exp(x)+exp(−x)exp(x)−exp(−x) 有关更多详细信息,请参阅 Tanh。