mindspore/docs/api/api_python/numpy/mindspore.numpy.empty.rst

19 lines
741 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.numpy.empty
=================================
.. py:function:: mindspore.numpy.empty(shape, dtype=mstype.float32)
返回一个给定shape和类型的新数组而不进行初始化。
.. note::
不支持原生Numpy接口的 ``order`` 参数,不支持对象数组。
参数:
- **shape** (Union[int, tuple(int)]) - 空数组的shape例如(2, 3) 或 2。
- **dtype** (mindspore.dtype, 可选) - 数组所需输出的数据类型,例如 ``mstype.int8`` 。默认值: ``mstype.float32``
返回:
Tensor给定shape、数据类型的未初始化任意数据的数组。
异常:
- **TypeError** - 如果输入的shape或数据类型无效。