提交 e32d667b authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Add test for mixed int/scalar variable in "size" arg of mrg samples

上级 4c9bcb9e
...@@ -370,7 +370,9 @@ def test_uniform(): ...@@ -370,7 +370,9 @@ def test_uniform():
x = tensor.matrix() x = tensor.matrix()
for size, var_input, input in [ for size, var_input, input in [
(sample_size, [], []), (sample_size, [], []),
(x.shape, [x], [numpy.zeros(sample_size, dtype=config.floatX)]) (x.shape, [x], [numpy.zeros(sample_size, dtype=config.floatX)]),
((x.shape[0], sample_size[1]), [x],
[numpy.zeros(sample_size, dtype=config.floatX)])
]: ]:
#### TEST CPU IMPLEMENTATION #### #### TEST CPU IMPLEMENTATION ####
...@@ -456,7 +458,9 @@ def test_binomial(): ...@@ -456,7 +458,9 @@ def test_binomial():
for mean in [0.1, 0.5]: for mean in [0.1, 0.5]:
for size, var_input, input in [ for size, var_input, input in [
(sample_size, [], []), (sample_size, [], []),
(x.shape, [x], [numpy.zeros(sample_size, dtype=config.floatX)]) (x.shape, [x], [numpy.zeros(sample_size, dtype=config.floatX)]),
((x.shape[0], sample_size[1]), [x],
[numpy.zeros(sample_size, dtype=config.floatX)])
]: ]:
#print '' #print ''
...@@ -526,6 +530,9 @@ def test_normal0(): ...@@ -526,6 +530,9 @@ def test_normal0():
(x.shape, sample_size, [x], (x.shape, sample_size, [x],
[numpy.zeros(sample_size, dtype=config.floatX)], [numpy.zeros(sample_size, dtype=config.floatX)],
-5., default_rtol), -5., default_rtol),
((x.shape[0], sample_size[1]), sample_size, [x],
[numpy.zeros(sample_size, dtype=config.floatX)],
-5., default_rtol),
#test odd value #test odd value
(sample_size_odd, sample_size_odd, [], [], -5., default_rtol), (sample_size_odd, sample_size_odd, [], [], -5., default_rtol),
#test odd value #test odd value
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论