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

17 lines
628 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.zeros
====================
.. py:function:: mindspore.ops.zeros(shape, dtype=None)
创建一个填满0的Tensorshape由 `shape` 决定, dtype由 `dtype` 决定。
参数:
- **shape** (Union[tuple[int], int]) - 用来描述所创建的Tensor的 `shape`
- **dtype** (:class:`mindspore.dtype`, 可选) - 用来描述所创建的Tensor的 `dtype`。如果为None那么将会使用mindspore.float32。默认值None。
返回:
Tensordtype和shape由入参决定。
异常:
- **TypeError** - 如果 `shape` 既不是int也不是int的元组。