mindspore/docs/api/api_python/ops/mindspore.ops.NPUGetFloatSt...

20 lines
1.1 KiB
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.NPUGetFloatStatus
================================
.. py:class:: mindspore.ops.NPUGetFloatStatus
在执行 :class:`mindspore.ops.NPUAllocFloatStatus` 后, `NPUGetFloatStatus` 获取最新溢出状态并更新标识。
.. note::
标志是一个Tensor其shape为 :math:`(8,)` ,数据类型为 `mindspore.dtype.float32` 。如果标志的和等于0则没有发生溢出。如果标志之和大于0则发生溢出。此外使用有严格的顺序要求即在使用 `NPUGetFloatStatus` 算子之前,需要确保 :class:`mindspore.ops.NPUClearFloatStatus` 和需执行的计算已执行。使用 :class:`mindspore.ops.Depend` 确保执行顺序。
输入:
- **x** (Tensor) - :class:`mindspore.ops.NPUAllocFloatStatus` 的输出Tensor。数据类型必须为float16或float32。 :math:`(N,*)` ,其中 :math:`*` 表示任意附加维度其rank应小于8。
输出:
Tensorshape与 `x` 相同。Tensor中的所有元素都将为零。
异常:
- **TypeError** - 如果 `x` 不是Tensor。
- **TypeError** - 如果 `x` 的数据类型既不是float16也不是float32。