提交 26f29455 authored 作者: abergeron's avatar abergeron

Merge pull request #2671 from carriepl/fix_buildbot_tests

Fix buildbot tests
...@@ -3307,9 +3307,10 @@ class T_Scan(unittest.TestCase): ...@@ -3307,9 +3307,10 @@ class T_Scan(unittest.TestCase):
g_output0 + g_output1) g_output0 + g_output1)
# Run the function and validate the outputs # Run the function and validate the outputs
seq_value = numpy.random.random((10, 3)) dtype = theano.config.floatX
out_init_value = numpy.random.random((3, 3)) seq_value = numpy.random.random((10, 3)).astype(dtype)
non_seq_value = numpy.random.random((3)) out_init_value = numpy.random.random((3, 3)).astype(dtype)
non_seq_value = numpy.random.random((3)).astype(dtype)
outputs = fct(seq_value, out_init_value, non_seq_value) outputs = fct(seq_value, out_init_value, non_seq_value)
...@@ -3994,14 +3995,14 @@ class T_Scan(unittest.TestCase): ...@@ -3994,14 +3995,14 @@ class T_Scan(unittest.TestCase):
def _scan_strict(x, w_ns): def _scan_strict(x, w_ns):
return tensor.dot(x, w_ns) return tensor.dot(x, w_ns)
ret_loose = theano.scan(_scan_loose, ret_loose = theano.scan(_scan_loose,
sequences=[], sequences=[],
outputs_info=[x0_], outputs_info=[x0_],
n_steps=n, n_steps=n,
strict=False) strict=False)
f_loose = theano.function([x0_], ret_loose[0][-1]) f_loose = theano.function([x0_], ret_loose[0][-1])
ret_strict = theano.scan(_scan_strict, ret_strict = theano.scan(_scan_strict,
sequences=[], sequences=[],
outputs_info=[x0_], outputs_info=[x0_],
non_sequences=[w_], non_sequences=[w_],
...@@ -4028,7 +4029,7 @@ class T_Scan(unittest.TestCase): ...@@ -4028,7 +4029,7 @@ class T_Scan(unittest.TestCase):
def _scan_loose(x): def _scan_loose(x):
return tensor.dot(x, w_) return tensor.dot(x, w_)
ret_strict = theano.scan(_scan_loose, ret_strict = theano.scan(_scan_loose,
sequences=[], sequences=[],
outputs_info=[x0_], outputs_info=[x0_],
n_steps=n, n_steps=n,
......
...@@ -298,10 +298,12 @@ class test_RopLop(RopLop_checker): ...@@ -298,10 +298,12 @@ class test_RopLop(RopLop_checker):
ev_input, ev_filters]) ev_input, ev_filters])
scan_f = function([input, filters, ev_input, ev_filters], sy, scan_f = function([input, filters, ev_input, ev_filters], sy,
on_unused_input='ignore') on_unused_input='ignore')
image_data = numpy.random.random(image_shape)
filter_data = numpy.random.random(filter_shape) dtype = theano.config.floatX
ev_image_data = numpy.random.random(image_shape) image_data = numpy.random.random(image_shape).astype(dtype)
ev_filter_data = numpy.random.random(filter_shape) filter_data = numpy.random.random(filter_shape).astype(dtype)
ev_image_data = numpy.random.random(image_shape).astype(dtype)
ev_filter_data = numpy.random.random(filter_shape).astype(dtype)
v1 = rop_f(image_data, filter_data, ev_image_data, v1 = rop_f(image_data, filter_data, ev_image_data,
ev_filter_data) ev_filter_data)
v2 = scan_f(image_data, filter_data, ev_image_data, v2 = scan_f(image_data, filter_data, ev_image_data,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论