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

26 lines
795 B
ReStructuredText
Raw 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.ReduceOp
======================
.. py:class:: mindspore.ops.ReduceOp
规约张量的操作选项。这是枚举类型,而不是运算符。
主要调用方法如下:
- SUMReduceOp.SUM.
- MAXReduceOp.MAX.
- MINReduceOp.MIN.
- PRODReduceOp.PROD.
.. note::
有关更多信息,请参阅示例。这需要在具有多个加速卡的环境中运行。
在运行以下示例之前,用户需要预设环境变量,请参考官方网站 `MindSpore \
<https://www.mindspore.cn/docs/zh-CN/master/api_python/mindspore.ops.html#通信算子>`_ 。
有四种操作选项,"SUM"、"MAX"、"MIN"和"PROD"。
- SUM求和。
- MAX求最大值。
- MIN求最小值。
- PROD求乘积。