mindspore.ops.fill
- mindspore.ops.fill(type, shape, value)[source]
Create a tensor filled with a specified value.
Warning
This API is deprecated and will be removed after version 2.9.0. Please use
mindspore.ops.full()instead.- Parameters
- Returns
Tensor
- Supported Platforms:
AscendGPUCPU
Examples
>>> import mindspore >>> mindspore.ops.fill(mindspore.float32, (2, 3), 1.2) Tensor(shape=[2, 3], dtype=Float32, value= [[ 1.20000005e+00, 1.20000005e+00, 1.20000005e+00], [ 1.20000005e+00, 1.20000005e+00, 1.20000005e+00]])