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

21 lines
750 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.full
==================
.. py:function:: mindspore.ops.full(size, fill_value, *, dtype=None)
创建一个指定shape的Tensor并用指定值填充。
参数:
- **size** (Union(tuple[int], list[int])) - 指定输出Tensor的shape。
- **fill_value** (number.Number) - 用来填充输出Tensor的值。当前不支持复数类型。
关键字参数:
- **dtype** (mindspore.dtype) - 指定输出Tensor的数据类型。数据类型只支持 `bool_``number` ,更多细节详见 :class:`mindspore.dtype` 。默认值None。
返回:
Tensor。
异常:
- **TypeError** - `size` 不是元组。
- **ValueError** - `size` 中包含小于0的成员。