提交 2e98ca4e authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #1545 from lamblin/add_mrg_tests

Add test for mixed int/scalar variable in "size" arg of mrg samples
......@@ -370,7 +370,9 @@ def test_uniform():
x = tensor.matrix()
for size, var_input, input in [
(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 ####
......@@ -456,7 +458,9 @@ def test_binomial():
for mean in [0.1, 0.5]:
for size, var_input, input in [
(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 ''
......@@ -526,6 +530,9 @@ def test_normal0():
(x.shape, sample_size, [x],
[numpy.zeros(sample_size, dtype=config.floatX)],
-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
(sample_size_odd, sample_size_odd, [], [], -5., default_rtol),
#test odd value
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论