2021-12-07 12:17:56 +08:00
|
|
|
|
mindspore.ops.Fill
|
|
|
|
|
|
==================
|
|
|
|
|
|
|
2021-12-21 18:09:08 +08:00
|
|
|
|
.. py:class:: mindspore.ops.Fill()
|
2021-12-07 12:17:56 +08:00
|
|
|
|
|
2021-12-21 18:09:08 +08:00
|
|
|
|
创建一个指定shape的Tensor,并用指定值填充。
|
2021-12-07 12:17:56 +08:00
|
|
|
|
|
|
|
|
|
|
**输入:**
|
|
|
|
|
|
|
2022-01-18 17:23:24 +08:00
|
|
|
|
- **type** (mindspore.dtype) - 指定输出Tensor的数据类型。数据类型只支持 `bool_ <https://www.mindspore.cn/docs/api/zh-CN/master/api_python/mindspore.html#mindspore.dtype>`_ 和 `number <https://www.mindspore.cn/docs/api/zh-CN/master/api_python/mindspore.html#mindspore.dtype>`_ 。
|
2021-12-21 18:09:08 +08:00
|
|
|
|
- **shape** (tuple[int]) - 指定输出Tensor的shape。
|
|
|
|
|
|
- **value** (Union(number.Number, bool)) - 用来填充输出Tensor的值。
|
2021-12-07 12:17:56 +08:00
|
|
|
|
|
|
|
|
|
|
**输出:**
|
|
|
|
|
|
|
2021-12-21 18:09:08 +08:00
|
|
|
|
Tensor。
|
2021-12-07 12:17:56 +08:00
|
|
|
|
|
|
|
|
|
|
**异常:**
|
|
|
|
|
|
|
|
|
|
|
|
**TypeError** - `shape` 不是元组。
|