You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.ops.Zeros.rst 652 B

12345678910111213141516171819202122
  1. mindspore.ops.Zeros
  2. ====================
  3. .. py:class:: mindspore.ops.Zeros
  4. 创建一个值全为0的Tensor。
  5. 第一个参数指定Tensor的shape,第二个参数指定填充值的数据类型。
  6. **输入:**
  7. - **shape** (Union[tuple[int], int]) - 指定输出Tensor的shape,只能是正整数常量。
  8. - **type** (mindspore.dtype) - 指定输出Tensor的数据类型,只能是常量值。
  9. **输出:**
  10. Tensor,数据类型和shape与输入shape相同。
  11. **异常:**
  12. - **TypeError** - `shape` 既不是int也不是tuple。
  13. - **TypeError** - `shape` 是tuple,其元素并非全部是int。