mindspore.mint.full
- mindspore.mint.full(size, fill_value, *, dtype=None)[source]
Create a Tensor of the specified shape and fill it with the specified value.
- Parameters
- Keyword Arguments
dtype (mindspore.dtype) – The specified type of output tensor. bool_ and number are supported, for details, please refer to
mindspore.dtype
. Default:None
.- Returns
Tensor.
- Raises
TypeError – If size is not a tuple or list.
ValueError – The element in size is less than 0.
- Supported Platforms:
Ascend
Examples
>>> from mindspore import mint >>> output = mint.full((2, 2), 1) >>> print(output) [[1. 1.] [1. 1.]] >>> output = mint.full((3, 3), 0) >>> print(output) [[0. 0. 0.] [0. 0. 0.] [0. 0. 0.]]