mindspore.ops.laplace
- mindspore.ops.laplace(shape, mean, lambda_param, seed=None)[source]
Generates random numbers according to the Laplace random number distribution.
Support broadcasting.
\[\text{f}(x;μ,λ) = \frac{1}{2λ}\exp(-\frac{|x-μ|}{λ}),\]Warning
The Ascend backend does not support the reproducibility of random numbers, so the seed parameter has no effect.
- Parameters
- Returns
Tensor
- Supported Platforms:
Ascend
GPU
CPU
Examples
>>> import mindspore >>> shape = (2, 3) >>> mean = mindspore.tensor(1.0, mindspore.float32) >>> lambda_param = mindspore.tensor(1.0, mindspore.float32) >>> output = mindspore.ops.laplace(shape, mean, lambda_param, seed=5) >>> print(output.shape) (2, 3)