提交 93c3e777 authored 作者: Pascal Lamblin's avatar Pascal Lamblin 提交者: GitHub

Merge pull request #5878 from bbudescu/rng-floatx

avoid creating float64 variables
......@@ -774,15 +774,17 @@ class MRG_RandomStreams(object):
"""
low = as_tensor_variable(low)
low = undefined_grad(low)
high = as_tensor_variable(high)
high = undefined_grad(high)
if dtype is None:
dtype = scal.upcast(config.floatX, low.dtype, high.dtype)
low = cast(low, dtype=dtype)
high = cast(high, dtype=dtype)
low = undefined_grad(low)
high = undefined_grad(high)
if isinstance(size, tuple):
msg = "size must be a tuple of int or a Theano variable"
assert all([isinstance(i, (np.integer, integer_types, Variable))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论