mindspore.ops.softsign ====================== .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://gitee.com/mindspore/mindspore/blob/master/docs/api/api_python/ops/mindspore.ops.func_softsign.rst :alt: 查看源文件 .. py:function:: mindspore.ops.softsign(x) SoftSign激活函数。 SoftSign函数定义为: .. math:: \text{SoftSign}(x) = \frac{x}{1 + |x|} Softsign函数图: .. image:: ../images/Softsign.png :align: center 参数: - **x** (Tensor) - shape为 :math:`(N, *)` 的Tensor,其中 :math:`*` 表示任意个数的维度。它的数据类型必须为float16或float32。 返回: Tensor,数据类型和shape与 `x` 相同。 异常: - **TypeError** - `x` 不是Tensor。 - **TypeError** - `x` 的数据类型既不是float16也不是float32。