poisson

paddle. poisson ( x, name=None ) [source]

This OP returns a tensor filled with random number from a Poisson Distribution.

\[out_i \sim Poisson (lambda = x_i)\]
Parameters
  • x (Tensor) – A tensor with rate parameter of poisson Distribution. The data type should be float32, float64.

  • name (str, optional) – The default value is None. Normally there is no need for user to set this property. For more information, please refer to Name.

Returns

A Tensor filled with random number with the same shape and dtype as x.

Return type

Tensor

Examples

import paddle
paddle.set_device('cpu')
paddle.seed(100)

x = paddle.uniform([2,3], min=1.0, max=5.0)
out = paddle.poisson(x)
#[[2., 5., 0.],
# [5., 1., 3.]]