Unverified 提交 ab69bf0b authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #6505 from abergeron/fix_bb

Fix problems in release buildbot
...@@ -4,6 +4,7 @@ from __future__ import absolute_import, print_function, division ...@@ -4,6 +4,7 @@ from __future__ import absolute_import, print_function, division
from mpi4py import MPI from mpi4py import MPI
import theano import theano
from theano.configparser import change_flags
from theano.tensor.io import send, recv, mpi_cmps from theano.tensor.io import send, recv, mpi_cmps
from theano.gof.sched import sort_schedule_fn from theano.gof.sched import sort_schedule_fn
import numpy as np import numpy as np
...@@ -27,7 +28,8 @@ scheduler = sort_schedule_fn(*mpi_cmps) ...@@ -27,7 +28,8 @@ scheduler = sort_schedule_fn(*mpi_cmps)
mode = theano.Mode(optimizer=None, mode = theano.Mode(optimizer=None,
linker=theano.OpWiseCLinker(schedule=scheduler)) linker=theano.OpWiseCLinker(schedule=scheduler))
if rank == 0: with change_flags(compute_test_value='off'):
if rank == 0:
x = theano.tensor.matrix('x', dtype=dtype) x = theano.tensor.matrix('x', dtype=dtype)
y = x + 1 y = x + 1
send_request = send(y, 1, 11) send_request = send(y, 1, 11)
...@@ -45,7 +47,7 @@ if rank == 0: ...@@ -45,7 +47,7 @@ if rank == 0:
# The parent test will look for "True" in the output # The parent test will look for "True" in the output
stdout.write(str(same)) stdout.write(str(same))
if rank == 1: if rank == 1:
y = recv(shape, dtype, 0, 11) y = recv(shape, dtype, 0, 11)
z = y * 2 z = y * 2
......
...@@ -4431,12 +4431,12 @@ class T_Join_and_Split(unittest.TestCase): ...@@ -4431,12 +4431,12 @@ class T_Join_and_Split(unittest.TestCase):
assert not isinstance(node.op, type(self.join_op)) assert not isinstance(node.op, type(self.join_op))
# Test dim 1 # Test dim 1
z = self.join_op(1, x1, x2, x3)
f = theano.function([], z.shape, mode=self.mode)
topo = f.maker.fgraph.toposort()
x1.set_value(get_mat(3, 4)) x1.set_value(get_mat(3, 4))
x2.set_value(get_mat(3, 4)) x2.set_value(get_mat(3, 4))
x3.set_value(get_mat(3, 5)) x3.set_value(get_mat(3, 5))
z = self.join_op(1, x1, x2, x3)
f = theano.function([], z.shape, mode=self.mode)
topo = f.maker.fgraph.toposort()
out = f() out = f()
assert (out == [3, 13]).all() assert (out == [3, 13]).all()
......
...@@ -47,7 +47,7 @@ def test_mpi_roundtrip(): ...@@ -47,7 +47,7 @@ def test_mpi_roundtrip():
raise SkipTest('MPI not enabled') raise SkipTest('MPI not enabled')
theano_root = theano.__file__.split('__init__')[0] theano_root = theano.__file__.split('__init__')[0]
env = os.environ.copy() env = os.environ.copy()
flags = env['THEANO_FLAGS'] flags = env.get('THEANO_FLAGS', '')
keep_flags = ','.join((f for f in flags.split(',') if not f.startswith('init_gpu_device'))) keep_flags = ','.join((f for f in flags.split(',') if not f.startswith('init_gpu_device')))
env['THEANO_FLAGS'] = keep_flags env['THEANO_FLAGS'] = keep_flags
p = subprocess.Popen("mpiexec -np 2 python " + theano_root + p = subprocess.Popen("mpiexec -np 2 python " + theano_root +
......
...@@ -421,6 +421,7 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin): ...@@ -421,6 +421,7 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
assert_array_equal(numpy_inc_subtensor(numpy_n4, [numpy_n > 2, Ellipsis, 0, 1], 1), assert_array_equal(numpy_inc_subtensor(numpy_n4, [numpy_n > 2, Ellipsis, 0, 1], 1),
inc_subtensor(n4[n > 2, ..., 0, 1], 1).eval()) inc_subtensor(n4[n > 2, ..., 0, 1], 1).eval())
with change_flags(compute_test_value='off'):
# the boolean mask should have the correct shape # the boolean mask should have the correct shape
# - too large, padded with True # - too large, padded with True
mask = np.array([True, False, True]) mask = np.array([True, False, True])
......
...@@ -9,7 +9,7 @@ import numpy as np ...@@ -9,7 +9,7 @@ import numpy as np
from six.moves import xrange from six.moves import xrange
import theano import theano
from theano import gof from theano import gof, change_flags
from theano.compat import izip from theano.compat import izip
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
...@@ -803,6 +803,7 @@ def test_grad_scale(): ...@@ -803,6 +803,7 @@ def test_grad_scale():
assert np.allclose(out, (8, 4)) assert np.allclose(out, (8, 4))
@change_flags(compute_test_value='off')
def test_undefined_grad_opt(): def test_undefined_grad_opt():
# Make sure that undefined grad get removed in optimized graph. # Make sure that undefined grad get removed in optimized graph.
random = RandomStreams(np.random.randint(1, 2147462579)) random = RandomStreams(np.random.randint(1, 2147462579))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论