mindspore/docs/api/api_python/ops/mindspore.ops.func_relu.rst

28 lines
830 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.relu
==================
.. py:function:: mindspore.ops.relu(input, inplace=False)
对输入Tensor逐元素计算线性修正单元激活函数Rectified Linear Unit值。
返回 :math:`\max(input,\ 0)` 的值。负值神经元将被设置为0正值神经元将保持不变。
.. math::
ReLU(input) = (input)^+ = \max(0, input)
ReLU激活函数图
.. image:: ../images/ReLU.png
:align: center
参数:
- **input** (Tensor) - 输入Tensor。
- **inplace** (bool, 可选) - 是否采用原地更新模式,默认值为 ``False``
返回:
Tensor其shape和数据类型与 `input` 一致。
异常:
- **TypeError** - `input` 的数据类型不是数值型。
- **TypeError** - `input` 不是Tensor。