2022-06-02 15:21:39 +08:00
|
|
|
|
mindspore.ops.softsign
|
|
|
|
|
|
======================
|
|
|
|
|
|
|
|
|
|
|
|
.. py:function:: mindspore.ops.softsign(x)
|
|
|
|
|
|
|
|
|
|
|
|
Softsign激活函数。
|
|
|
|
|
|
|
|
|
|
|
|
Softsign函数定义为:
|
|
|
|
|
|
|
|
|
|
|
|
.. math::
|
|
|
|
|
|
\text{SoftSign}(x) = \frac{x}{1 + |x|}
|
|
|
|
|
|
|
2022-07-26 10:27:56 +08:00
|
|
|
|
参数:
|
|
|
|
|
|
- **x** (Tensor) - shape为 :math:`(N, *)` 的Tensor,其中 :math:`*` 表示任意个数的维度。它的数据类型必须为float16或float32。
|
2022-06-02 15:21:39 +08:00
|
|
|
|
|
2022-07-26 10:27:56 +08:00
|
|
|
|
返回:
|
|
|
|
|
|
Tensor,数据类型和shape与 `x` 相同。
|
2022-06-02 15:21:39 +08:00
|
|
|
|
|
2022-07-26 10:27:56 +08:00
|
|
|
|
异常:
|
|
|
|
|
|
- **TypeError** - `x` 不是Tensor。
|
|
|
|
|
|
- **TypeError** - `x` 的数据类型既不是float16也不是float32。
|