提交 5c5a16e0 authored 作者: Frederic's avatar Frederic

Remove useless helper fct.

上级 2147e61b
...@@ -623,16 +623,6 @@ def choice(random_state, size=None, a=2, replace=True, p=None, ndim=None, ...@@ -623,16 +623,6 @@ def choice(random_state, size=None, a=2, replace=True, p=None, ndim=None,
broadcastable=bcast)) broadcastable=bcast))
return op(random_state, size, a, replace, p) return op(random_state, size, a, replace, p)
def poisson_helper(random_state, lam, size):
"""
Helper function to draw random numbers using numpy's poisson function.
This is a generalization of numpy.random.poisson to the case where
`lam` is a tensor.
"""
return random_state.poisson(lam, size)
def poisson(random_state, size=None, lam=1.0, ndim=None, dtype='int64'): def poisson(random_state, size=None, lam=1.0, ndim=None, dtype='int64'):
""" """
Draw samples from a Poisson distribution. Draw samples from a Poisson distribution.
...@@ -653,7 +643,7 @@ def poisson(random_state, size=None, lam=1.0, ndim=None, dtype='int64'): ...@@ -653,7 +643,7 @@ def poisson(random_state, size=None, lam=1.0, ndim=None, dtype='int64'):
ndim, size, bcast = _infer_ndim_bcast(ndim, size) ndim, size, bcast = _infer_ndim_bcast(ndim, size)
op = RandomFunction(poisson_helper, tensor.TensorType(dtype=dtype, op = RandomFunction("poisson", tensor.TensorType(dtype=dtype,
broadcastable=bcast)) broadcastable=bcast))
return op(random_state, size, lam) return op(random_state, size, lam)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论