mindspore.ops.standard_normal
- mindspore.ops.standard_normal(shape, seed=None)[source]
Generates random numbers according to the standard Normal (or Gaussian) random number distribution.
Warning
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect.
- Parameters
- Returns
Tensor
- Raises
ValueError – If shape is a tuple containing non-positive items.
ValueError – If shape is a Tensor, and the rank of the Tensor is not equal to 1.
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> shape = (4, 4) >>> output = mindspore.ops.standard_normal(shape, seed=5) >>> print(f'output shape is {output.shape}') output shape is (4, 4) (4, 4)