FillV2 docs

This commit is contained in:
hw_hz 2022-12-09 10:51:20 +08:00
parent cace511745
commit 529fff56ec
2 changed files with 14 additions and 16 deletions

View File

@ -6,17 +6,16 @@ mindspore.ops.FillV2
创建一个Tensor其shape由 `shape` 指定,其值则由 `value` 进行填充。 创建一个Tensor其shape由 `shape` 指定,其值则由 `value` 进行填充。
输入: 输入:
- **shape** (Tensor) - 1-D Tensor指定了输出Tensor的shape。 - **shape** (Union[Tuple[int], Tensor[int]) - 1-D Tensor或Tuple指定了输出Tensor的shape。
其数据类型必须是int32或int64。 其数据类型必须是int32或int64。
- **value** (Tensor) - 一个标量Tensor其值用于填充输出Tensor。 - **value** (Tensor) - `value` 是Scalar Tensor其值用于填充输出 `y` ,
`value` 必须是0-D的其数据类型必须是以下之一: 其数据类型必须是以下之一:bool、int8、int16、int32、int64、uint8、uint16、uint32、uint64、
bool、int8、int16、int32、int64、uint8、uint16、uint32、uint64、float16、float32、float64。 float16、float32、float64、complex64、complex128
输出: 输出:
- **y** (Tensor) - Tensor其shape和值如上所述。 - **y** (Tensor) - Tensor其shape和值如上所述。
异常: 异常:
- **ValueError** - 如果 `shape` 不是1-D Tensor。 - **TypeError** - 如果 `shape` 不是1-D Tensor或Tuple
- **TypeError** - 如果 `shape` 的数据类型不是int32或者int64。 - **TypeError** - 如果 `shape` 的数据类型不是int32或者int64。
- **ValueError** - 如果 `value` 不是0-D Tensor。 - **ValueError** - 如果 `value` 不是Scalar Tensor。
- **ValueError** - 如果输出元素的数量多于1000000。

View File

@ -1525,20 +1525,19 @@ class FillV2(PrimitiveWithCheck):
Creates a tensor with shape described by `shape` and fills it with values in `value` . Creates a tensor with shape described by `shape` and fills it with values in `value` .
Inputs: Inputs:
- **shape** (tensor) - 1-D Tensor, the specified shape of output tensor. - **shape** (Union[Tuple[int], Tensor[int]]) - 1-D Tensor or Tuple, specify the shape
It's dtype must be int32 or int64. of output tensor. Its dtype must be int32 or int64.
- **value** (tensor) - A scalar tensor, the value to fill the output tensor. - **value** (Tensor) - A scalar tensor, the value to fill the output tensor `y` .
The shape of `value` must be 0D and it's dtype must be one of the following types: Its dtype must be one of the following types: bool, int8, int16, int32, int64,
bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64. uint8, uint16, uint32, uint64, float16, float32, float64, complex64, complex128.
Outputs: Outputs:
- **y** (Tensor) - A tensor, it's shape and value are described above. - **y** (Tensor) - A tensor, its shape and value are described above.
Raises: Raises:
ValueError: If `shape` is not a 1-D tensor. TypeError: If `shape` is not a 1-D tensor or tuple.
TypeError: If the data type of `shape` is not int32 or int64. TypeError: If the data type of `shape` is not int32 or int64.
ValueError: If `value` is not a 0-D tensor. ValueError: If `value` is not a scalar tensor.
ValueError: If the number of output elements is greater than 1000000.
Supported Platforms: Supported Platforms:
``Ascend`` ``GPU`` ``CPU`` ``Ascend`` ``GPU`` ``CPU``