mindspore.Tensor.tanh
- mindspore.Tensor.tanh()
详情请参考
mindspore.ops.tanh()
。- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor >>> input = Tensor(np.array([1, 2, 3, 4, 5]), mindspore.float32) >>> output = Tensor.tanh(input) >>> print(output) [0.7615941 0.9640276 0.9950547 0.9993293 0.9999092]