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

22 lines
677 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第二个参数指定填充值的数据类型。
.. warning::
参数 `shape` 在后续版本中将不再支持Tensor类型的输入。
输入:
- **shape** (Union[tuple[int], list[int], int, Tensor]) - 指定输出Tensor的shape。
- **type** (mindspore.dtype) - 指定输出Tensor的数据类型。
输出:
Tensorshape和dtype由输入定义。
异常:
- **TypeError** - 如果 `shape` 不是一个int或元素为int的元组/列表/Tensor。