--- theano/compile/mode.py.orig 2019-01-15 14:13:57.000000000 -0700 +++ theano/compile/mode.py 2019-08-22 13:25:25.024334947 -0600 @@ -261,7 +261,7 @@ class Mode(object): def __init__(self, linker=None, optimizer='default'): if linker is None: linker = config.linker - if optimizer is 'default': + if optimizer == 'default': optimizer = config.optimizer Mode.__setstate__(self, (linker, optimizer)) --- theano/gof/opt.py.orig 2019-01-15 14:13:57.000000000 -0700 +++ theano/gof/opt.py 2019-08-22 14:06:43.820896086 -0600 @@ -1284,7 +1284,7 @@ def local_optimizer(tracks, inplace=Fals """ if tracks is not None: - if len(tracks) is 0: + if len(tracks) == 0: raise ValueError("Use None instead of an empty list to apply to all nodes.", f.__module__, f.__name__) for t in tracks: if not (isinstance(t, op.Op) or issubclass(t, op.PureOp)): --- theano/gof/tests/test_link.py.orig 2019-01-15 14:13:57.000000000 -0700 +++ theano/gof/tests/test_link.py 2019-08-22 16:29:02.294513027 -0600 @@ -113,7 +113,7 @@ class TestPerformLinker(unittest.TestCas def test_input_output_same(self): x, y, z = inputs() fn = perform_linker(FunctionGraph([x], [x])).make_function() - assert 1.0 is fn(1.0) + assert 1.0 == fn(1.0) def test_input_dependency0(self): x, y, z = inputs() --- theano/tensor/nnet/bn.py.orig 2019-01-15 14:13:57.000000000 -0700 +++ theano/tensor/nnet/bn.py 2019-08-22 13:35:49.109305914 -0600 @@ -642,7 +642,7 @@ class AbstractBatchNormTrainGrad(Op): # some inputs should be disconnected results = [g_wrt_x, g_wrt_dy, g_wrt_scale, g_wrt_x_mean, g_wrt_x_invstd, theano.gradient.DisconnectedType()()] - return [theano.gradient.DisconnectedType()() if r is 0 else r + return [theano.gradient.DisconnectedType()() if r == 0 else r for r in results] def connection_pattern(self, node): --- theano/tensor/nnet/tests/test_conv.py.orig 2019-01-15 14:13:57.000000000 -0700 +++ theano/tensor/nnet/tests/test_conv.py 2019-08-22 16:29:51.149656121 -0600 @@ -95,7 +95,7 @@ class TestConv2D(utt.InferShapeTester): # REFERENCE IMPLEMENTATION s = 1. orig_image_data = image_data - if border_mode is not 'full': + if border_mode != 'full': s = -1. out_shape2d = np.array(N_image_shape[-2:]) +\ s * np.array(N_filter_shape[-2:]) - s --- theano/tests/test_determinism.py.orig 2019-01-15 14:13:57.000000000 -0700 +++ theano/tests/test_determinism.py 2019-08-22 16:31:03.119393791 -0600 @@ -57,7 +57,7 @@ def test_determinism_1(): updates.append((s, val)) for var in theano.gof.graph.ancestors(update for _, update in updates): - if var.name is not None and var.name is not 'b': + if var.name is not None and var.name != 'b': if var.name[0] != 's' or len(var.name) != 2: var.name = None