提交 abc69153 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Move MRG RandomStream test to tests.sandbox.test_rng_mrg

上级 b51cfd09
......@@ -853,6 +853,25 @@ def test_gradient_scan():
f(np.arange(1, dtype="float32"))
def test_simple_shared_mrg_random():
theano_rng = MRG_RandomStreams(10)
values, updates = theano.scan(
lambda: theano_rng.uniform((2,), -1, 1),
[],
[],
[],
n_steps=5,
truncate_gradient=-1,
go_backwards=False,
)
my_f = theano.function([], values, updates=updates, allow_input_downcast=True)
# Just check for run-time errors
my_f()
my_f()
def test_multMatVect():
A1 = tensor.lmatrix("A1")
s1 = tensor.ivector("s1")
......
......@@ -1141,24 +1141,6 @@ class TestScan:
# Check for runtime errors
f(np.int32(0), np.float32(1.0), np.float32(0.5))
def test_simple_shared_mrg_random(self):
theano_rng = theano.sandbox.rng_mrg.MRG_RandomStreams(utt.fetch_seed())
values, updates = scan(
lambda: theano_rng.uniform((2,), -1, 1),
[],
[],
[],
n_steps=5,
truncate_gradient=-1,
go_backwards=False,
)
my_f = theano.function([], values, updates=updates, allow_input_downcast=True)
# Just check for run-time errors
my_f()
my_f()
def test_simple_shared_random(self):
theano_rng = theano.tensor.shared_randomstreams.RandomStreams(utt.fetch_seed())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论