mindspore.ops.random_gamma
- mindspore.ops.random_gamma(shape, alpha, seed=None)[source]
Generate random numbers from the Gamma distribution(s).
- Parameters
- Returns
Tensor, the shape is mindspore.ops.concat([shape, rate.shape], axis=0). The data type is the same as alpha.
- Supported Platforms:
CPU
Examples
>>> import mindspore >>> shape = mindspore.tensor([7, 5], mindspore.int32) >>> alpha = mindspore.tensor([0.5, 1.5], mindspore.float32) >>> output = mindspore.ops.random_gamma(shape, alpha, seed=5) >>> print(output.shape, output.dtype) (7, 5, 2) Float32