forked from mindspore-Ecosystem/mindspore
FillV2 docs
This commit is contained in:
parent
cace511745
commit
529fff56ec
|
@ -6,17 +6,16 @@ mindspore.ops.FillV2
|
|||
创建一个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。
|
||||
- **value** (Tensor) - 一个标量Tensor,其值用于填充输出Tensor。
|
||||
`value` 必须是0-D的,且其数据类型必须是以下之一:
|
||||
bool、int8、int16、int32、int64、uint8、uint16、uint32、uint64、float16、float32、float64。
|
||||
- **value** (Tensor) - `value` 是Scalar Tensor,其值用于填充输出 `y` ,
|
||||
其数据类型必须是以下之一:bool、int8、int16、int32、int64、uint8、uint16、uint32、uint64、
|
||||
float16、float32、float64、complex64、complex128。
|
||||
|
||||
输出:
|
||||
- **y** (Tensor) - Tensor,其shape和值如上所述。
|
||||
|
||||
异常:
|
||||
- **ValueError** - 如果 `shape` 不是1-D Tensor。
|
||||
- **TypeError** - 如果 `shape` 不是1-D Tensor或Tuple。
|
||||
- **TypeError** - 如果 `shape` 的数据类型不是int32或者int64。
|
||||
- **ValueError** - 如果 `value` 不是0-D Tensor。
|
||||
- **ValueError** - 如果输出元素的数量多于1000000。
|
||||
- **ValueError** - 如果 `value` 不是Scalar Tensor。
|
||||
|
|
|
@ -1525,20 +1525,19 @@ class FillV2(PrimitiveWithCheck):
|
|||
Creates a tensor with shape described by `shape` and fills it with values in `value` .
|
||||
|
||||
Inputs:
|
||||
- **shape** (tensor) - 1-D Tensor, the specified shape of output tensor.
|
||||
It's dtype must be int32 or int64.
|
||||
- **value** (tensor) - A scalar tensor, the value to fill the output tensor.
|
||||
The shape of `value` must be 0D and it's dtype must be one of the following types:
|
||||
bool, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float16, float32, float64.
|
||||
- **shape** (Union[Tuple[int], Tensor[int]]) - 1-D Tensor or Tuple, specify the shape
|
||||
of output tensor. Its dtype must be int32 or int64.
|
||||
- **value** (Tensor) - A scalar tensor, the value to fill the output tensor `y` .
|
||||
Its dtype must be one of the following types: bool, int8, int16, int32, int64,
|
||||
uint8, uint16, uint32, uint64, float16, float32, float64, complex64, complex128.
|
||||
|
||||
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:
|
||||
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.
|
||||
ValueError: If `value` is not a 0-D tensor.
|
||||
ValueError: If the number of output elements is greater than 1000000.
|
||||
ValueError: If `value` is not a scalar tensor.
|
||||
|
||||
Supported Platforms:
|
||||
``Ascend`` ``GPU`` ``CPU``
|
||||
|
|
Loading…
Reference in New Issue