提交 0f7f9361 authored 作者: Rémi Louf's avatar Rémi Louf 提交者: Brandon T. Willard

Add docstring for `IntegersRV`

上级 707e849c
......@@ -1648,6 +1648,11 @@ randint = RandIntRV()
class IntegersRV(RandomVariable):
r"""A discrete uniform random variable.
Only available for `RandomGeneratorType`. Use `randint` with `RandomStateType`\s.
"""
name = "integers"
ndim_supp = 0
ndims_params = [0, 0]
......@@ -1655,6 +1660,23 @@ class IntegersRV(RandomVariable):
_print_name = ("integers", "\\operatorname{integers}")
def __call__(self, low, high=None, size=None, **kwargs):
r"""Draw samples from a discrete uniform distribution.
Parameters
----------
low
Lower boundary of the output interval. All values generated
will be greater than or equal to `low` (inclusive).
high
Upper boundary of the output interval. All values generated
will be smaller than `high` (exclusive).
size
Sample shape. If the given size is `(m, n, k)`, then `m * n * k`
independent, identically distributed samples are
returned. Default is `None`, in which case a single sample
is returned.
"""
if high is None:
low, high = 0, low
return super().__call__(low, high, size=size, **kwargs)
......
......@@ -49,6 +49,9 @@ Distributions
Aesara can produce :class:`RandomVariable`\s that draw samples from many different statistical distributions, using the following :class:`Op`\s.
.. autoclass:: aesara.tensor.random.basic.IntegersRV
:members: __call__
.. autoclass:: aesara.tensor.random.basic.ChoiceRV
:members: __call__
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论