mindspore/docs/api/api_python/nn/mindspore.nn.HSwish.rst

23 lines
635 B
ReStructuredText
Raw Normal View History

2021-12-04 13:55:42 +08:00
mindspore.nn.HSwish
===================
.. py:class:: mindspore.nn.HSwish
2022-08-26 11:32:26 +08:00
对输入的每个元素计算Hard Swish。input是具有任何有效形状的张量。
2021-12-04 13:55:42 +08:00
Hard Swish定义如下
.. math::
\text{hswish}(x_{i}) = x_{i} * \frac{ReLU6(x_{i} + 3)}{6},
其中, :math:`x_i` 是输入的元素。
2022-07-22 16:25:38 +08:00
输入:
- **x** (Tensor) - 用于计算Hard Swish的Tensor。shape为 :math:`(N,*)` ,其中 :math:`*` 表示任意的附加维度数。
2021-12-04 13:55:42 +08:00
2022-07-22 16:25:38 +08:00
输出:
Tensor具有与 `x` 相同的数据类型和shape。
2021-12-04 13:55:42 +08:00
2022-07-22 16:25:38 +08:00
异常:
- **TypeError** - `x` 的数据类型不支持。