mindspore2022/docs/api/api_python/ops/mindspore.ops.Zeros.rst

22 lines
652 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.Zeros
====================
.. py:class:: mindspore.ops.Zeros
创建一个值全为0的Tensor。
第一个参数指定Tensor的shape第二个参数指定填充值的数据类型。
**输入:**
- **shape** (Union[tuple[int], int]) - 指定输出Tensor的shape只能是正整数常量。
- **type** (mindspore.dtype) - 指定输出Tensor的数据类型只能是常量值。
**输出:**
Tensor数据类型和shape与输入shape相同。
**异常:**
- **TypeError** - `shape` 既不是int也不是tuple。
- **TypeError** - `shape` 是tuple其元素并非全部是int。