提交 b52069af authored 作者: abergeron's avatar abergeron

Merge pull request #2560 from lamblin/fix_buildbot

Fix few tests for the nightly buildbot
...@@ -379,7 +379,7 @@ class T_Scan(unittest.TestCase): ...@@ -379,7 +379,7 @@ class T_Scan(unittest.TestCase):
fun = theano.function([inp], [broadcasted_inp, gr]) fun = theano.function([inp], [broadcasted_inp, gr])
# Execute the Theano function and compare outputs to the expected outputs # Execute the Theano function and compare outputs to the expected outputs
inputs = numpy.array([[1, 2], [3, 4]]) inputs = numpy.array([[1, 2], [3, 4]], dtype=theano.config.floatX)
expected_out1 = numpy.repeat(inputs[None], n_steps, axis=0) expected_out1 = numpy.repeat(inputs[None], n_steps, axis=0)
expected_out2 = numpy.ones(inputs.shape, dtype="int8") * n_steps expected_out2 = numpy.ones(inputs.shape, dtype="int8") * n_steps
......
...@@ -1135,7 +1135,10 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin): ...@@ -1135,7 +1135,10 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
m2_ref = m_val.copy() m2_ref = m_val.copy()
m1_val, m2_val = f(m_val, i_val) m1_val, m2_val = f(m_val, i_val)
for idx in i_val: # We have to explicitly loop over all individual indices,
# not as a list or array, numpy only increments the indexed
# elements once even if the indices are repeated.
for idx in i_val.ravel():
m1_ref[:, idx] = 0 m1_ref[:, idx] = 0
m2_ref[:, idx] += 1 m2_ref[:, idx] += 1
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论