8e23a3ec47a2ccbf6cdd222a80886c6b9f17264f,tests/keras/backend/backend_test.py,TestBackend,test_update_add,#TestBackend#,584

Before Change


    @pytest.mark.skipif(K.backend() == "theano",
                        reason="theano returns tuples for update ops")
    def test_update_add(self):
        x = np.random.randn(3, 4)
        x_var = K.variable(x)
        increment = np.random.randn(3, 4)

        x += increment

After Change


    @pytest.mark.skipif(K.backend() == "theano",
                        reason="theano returns tuples for update ops")
    def test_update_add(self):
        x = np.ones((3, 4))
        x_var = K.variable(x)
        increment = np.random.random((3, 4))

        op = K.update_add(x_var, increment)
        K.eval(op)

        assert_allclose(x + increment, K.eval(x_var), atol=1e-05)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/keras
Commit Name: 8e23a3ec47a2ccbf6cdd222a80886c6b9f17264f
Time: 2019-03-21
Author: francois.chollet@gmail.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_update_add


Project Name: keras-team/keras
Commit Name: acbae2cebb13a18412b439ed237fbc23abace69a
Time: 2015-12-05
Author: eder@macbook.com
File Name: tests/keras/layers/test_call.py
Class Name: TestCall
Method Name: test_layer_call


Project Name: keras-team/keras
Commit Name: 8e23a3ec47a2ccbf6cdd222a80886c6b9f17264f
Time: 2019-03-21
Author: francois.chollet@gmail.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_update_sub