latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay.functional.poisson
- tensorplay.functional.poisson(input, generator=None) Tensor[source]
Returns a tensor of the same size as
inputwith each element sampled from a Poisson distribution with rate parameter given by the corresponding element ininputi.e.,inputmust be non-negative.- Parameters:
input (Tensor) – the input tensor containing the rates of the Poisson distribution
- Keyword Arguments:
generator (
tensorplay.Generator, optional) – a pseudorandom number generator for sampling
Example:
>>> rates = tensorplay.rand(4, 4) * 5 # rate parameter between 0 and 5 >>> tensorplay.poisson(rates) tensor([[9., 1., 3., 5.], [8., 6., 6., 0.], [0., 4., 5., 3.], [2., 1., 4., 2.]])
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

