提交 2aa1e4ac authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Again, a few more tests fixed in float32

上级 3ab93519
......@@ -358,7 +358,7 @@ class T_SharedRandomStreams(unittest.TestCase):
def test_vector_arguments(self):
random = RandomStreams(utt.fetch_seed())
low = tensor.dvector()
out = random.uniform(low=low, high=1)
out = random.uniform(low=low, high=1, dtype='float64')
assert out.ndim == 1
f = function([low], out)
......@@ -372,7 +372,7 @@ class T_SharedRandomStreams(unittest.TestCase):
assert numpy.all(val1 == numpy_val1)
high = tensor.vector()
outb = random.uniform(low=low, high=high)
outb = random.uniform(low=low, high=high, dtype='float64')
assert outb.ndim == 1
fb = function([low, high], outb)
......@@ -388,7 +388,7 @@ class T_SharedRandomStreams(unittest.TestCase):
#self.assertRaises(ValueError, fb, [-4., -2], [-1])
size = tensor.lvector()
outc = random.uniform(low=low, high=high, size=size, ndim=1)
outc = random.uniform(low=low, high=high, size=size, ndim=1, dtype='float64')
fc = function([low, high, size], outc)
numpy_rng = numpy.random.RandomState(int(seed_gen.randint(2**30)))
......@@ -431,7 +431,7 @@ class T_SharedRandomStreams(unittest.TestCase):
random = RandomStreams(utt.fetch_seed())
low = tensor.dvector()
high = tensor.dvector()
out = random.uniform(low=low, high=high)
out = random.uniform(low=low, high=high, dtype='float64')
assert out.ndim == 1
f = function([low, high], out)
......@@ -455,7 +455,7 @@ class T_SharedRandomStreams(unittest.TestCase):
assert numpy.all(val1 == numpy_val1)
# Specifying the size explicitly
g = function([low, high], random.uniform(low=low, high=high, size=(3,)))
g = function([low, high], random.uniform(low=low, high=high, size=(3,), dtype='float64'))
val2 = g(low_val, high_val)
numpy_rng = numpy.random.RandomState(int(seed_gen.randint(2**30)))
numpy_val2 = numpy_rng.uniform(low=low_val, high=high_val, size=(3,))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论