mindspore/docs/api/api_python/ops/mindspore.ops.Poisson.rst

27 lines
1.0 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.Poisson
=====================
.. py:class:: mindspore.ops.Poisson(seed=0, seed2=0)
生成 Poisson 分布的随机数。
.. math::
\text{P}(i|μ) = \frac{\exp(-μ)μ^{i}}{i!},
参数:
- **seed** (int) - 算子层的随机种子用于生成随机数。必须是非负的。默认值0。
- **seed2** (int) - 全局的随机种子和算子层的随机种子共同决定最终生成的随机数。必须是非负的。默认值0。
输入:
- **shape** (tuple) - 待生成的随机 Tensor 的 shape。只支持常量值。
- **mean** (Tensor) - Poisson 分布的期望,也就是上面公式中的 μ。其值必须大于0。数据类型为 float32。
输出:
Tensor。shape是输入 `shape``mean` 广播后的 shape。数据类型为 int32。
异常:
- **TypeError** - `seed``seed2` 的数据类型不是 int。
- **TypeError** - `shape` 不是 tuple。
- **TypeError** - `mean` 不是数据类型为 float32 的 Tensor。