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

18 lines
860 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.Assert
=====================
.. py:class:: mindspore.ops.Assert(summarize=3)
判断给定条件是否为True若不为True则以list的形式打印 `input_data` 中的Tensor否则继续往下运行代码。
参数:
- **summarize** (int, 可选) - 当判断结果为False时打印 `input_data` 中每个Tensor的条目的数量。默认值3。
输入:
- **condition** ([Union[Tensor[bool], bool]]) - 需要进行判断的条件。
- **input_data** (Union(tuple[Tensor], list[Tensor])) - 当 `condition` 被判断为False的时候将被打印的Tensor。
异常:
- **TypeError** - `summarize` 的数据类型不是int。
- **TypeError** - `condition` 的数据格式不是Tensor或bool。
- **TypeError** - `input_data` 的数据格式不是list或tuple。