mindspore.ops.tanhshrink

View Source On Gitee
mindspore.ops.tanhshrink(input)[source]

Apply the element-wise Tanhshrink function.

Tanhshrink(x)=xTanh(x)
Parameters

input (Tensor) – The input tensor.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> output = mindspore.ops.tanhshrink(mindspore.tensor([1., 2., 3., 2., 1.]))
>>> print(output)
[0.23840582 1.0359724  2.0049443  1.0359724  0.23840582]