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

27 lines
1.0 KiB
ReStructuredText
Raw Normal View History

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