mindspore.ops.standard_laplace
- mindspore.ops.standard_laplace(shape, seed=None)[source]
Generates random numbers according to the Laplace random number distribution (mean=0, lambda=1).
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_laplace(shape, seed=5) >>> print(f'output shape is {output.shape}') output shape is (4, 4)