!6228 Restrict the range of the parameters in random ops

Merge pull request !6228 from peixu_ren/custom_bijector
pull/6228/MERGE
mindspore-ci-bot 5 years ago committed by Gitee
commit 882b5a43a9

@ -49,7 +49,8 @@ def normal(shape, mean, stddev, seed=0):
shape (tuple): The shape of random tensor to be generated. shape (tuple): The shape of random tensor to be generated.
mean (Tensor): The mean μ distribution parameter, which specifies the location of the peak. mean (Tensor): The mean μ distribution parameter, which specifies the location of the peak.
With float32 data type. With float32 data type.
stddev (Tensor): The deviation σ distribution parameter. With float32 data type. stddev (Tensor): The deviation σ distribution parameter. It should be greater than 0.
With float32 data type.
seed (int): Seed is used as entropy source for Random number engines generating pseudo-random numbers. seed (int): Seed is used as entropy source for Random number engines generating pseudo-random numbers.
Must be non-negative. Default: 0. Must be non-negative. Default: 0.
@ -136,8 +137,8 @@ def gamma(shape, alpha, beta, seed=0):
Args: Args:
shape (tuple): The shape of random tensor to be generated. shape (tuple): The shape of random tensor to be generated.
alpha (Tensor): The alpha α distribution parameter. With float32 data type. alpha (Tensor): The alpha α distribution parameter. It should be greater than 0. With float32 data type.
beta (Tensor): The beta β distribution parameter. With float32 data type. beta (Tensor): The beta β distribution parameter. It should be greater than 0. With float32 data type.
seed (int): Seed is used as entropy source for Random number engines generating pseudo-random numbers. seed (int): Seed is used as entropy source for Random number engines generating pseudo-random numbers.
Must be non-negative. Default: 0. Must be non-negative. Default: 0.
@ -164,7 +165,7 @@ def poisson(shape, mean, seed=0):
Args: Args:
shape (tuple): The shape of random tensor to be generated. shape (tuple): The shape of random tensor to be generated.
mean (Tensor): The mean μ distribution parameter. With float32 data type. mean (Tensor): The mean μ distribution parameter. It should be greater than 0. With float32 data type.
seed (int): Seed is used as entropy source for Random number engines generating pseudo-random numbers. seed (int): Seed is used as entropy source for Random number engines generating pseudo-random numbers.
Must be non-negative. Default: 0. Must be non-negative. Default: 0.

@ -130,9 +130,9 @@ class Gamma(PrimitiveWithInfer):
Inputs: Inputs:
- **shape** (tuple) - The shape of random tensor to be generated. Only constant value is allowed. - **shape** (tuple) - The shape of random tensor to be generated. Only constant value is allowed.
- **alpha** (Tensor) - The α distribution parameter. - **alpha** (Tensor) - The α distribution parameter. It should be greater than 0.
It is also known as the shape parameter with float32 data type. It is also known as the shape parameter with float32 data type.
- **beta** (Tensor) - The β distribution parameter. - **beta** (Tensor) - The β distribution parameter. It should be greater than 0.
It is also known as the scale parameter with float32 data type. It is also known as the scale parameter with float32 data type.
Outputs: Outputs:
@ -185,8 +185,8 @@ class Poisson(PrimitiveWithInfer):
Inputs: Inputs:
- **shape** (tuple) - The shape of random tensor to be generated. Only constant value is allowed. - **shape** (tuple) - The shape of random tensor to be generated. Only constant value is allowed.
- **mean** (Tensor) - μ, parameter which the distribution was constructed with. - **mean** (Tensor) - μ parameter the distribution was constructed with. The parameter defines mean number
The parameter defines the mean number of occurrences of the event, with float32 data type. of occurrences of the event. It should be greater than 0. With float32 data type.
Outputs: Outputs:
Tensor. Its shape should be the broadcasted shape of `shape` and the shape of `mean`. Tensor. Its shape should be the broadcasted shape of `shape` and the shape of `mean`.

Loading…
Cancel
Save