0f4fec30f00b29aa206e36fe875c83ff6149b618,tests/keras/backend/test_backends.py,TestBackend,test_batch_dot_shape,#TestBackend#,84

Before Change


        check_single_tensor_operation("reverse", (4, 3, 2), axes=(1, 2))

    def test_batch_dot_shape(self):
        with pytest.raises(ValueError):
            x_batch = KTF.ones(shape=(32, 20))
            y_batch = KTF.ones(shape=(32, 20))
            xy_batch_dot = KTF.batch_dot(x_batch, y_batch, axes=1)

    def test_shape_operations(self):
        // concatenate
        xval = np.random.random((4, 3))
        xth = KTH.variable(xval)

After Change


        xy_batch_dot = KTF.batch_dot(x_batch, y_batch, axes=0)
        assert_allclose(KTF.eval(xy_batch_dot), np.ones((20, 1)) * 32, atol=1e-05)
        // making sure swapping axes when ndim == 2 works
        x_batch = KTF.ones(shape=(32, 20))
        y_batch = KTF.ones(shape=(20, 32))
        xy_batch_dot = KTF.batch_dot(x_batch, y_batch, axes=(0, 1))
        assert_allclose(KTF.eval(xy_batch_dot), np.ones((20, 1)) * 32, atol=1e-05)
        xy_batch_dot = KTF.batch_dot(x_batch, y_batch, axes=(1, 0))
        assert_allclose(KTF.eval(xy_batch_dot), np.ones((32, 1)) * 20, atol=1e-05)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: keras-team/keras
Commit Name: 0f4fec30f00b29aa206e36fe875c83ff6149b618
Time: 2017-02-06
Author: yves@dbtune.org
File Name: tests/keras/backend/test_backends.py
Class Name: TestBackend
Method Name: test_batch_dot_shape


Project Name: keras-team/keras
Commit Name: 5e797436c3defd2d863ac1ffab11c48dbd42588e
Time: 2018-02-25
Author: me@taehoonlee.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_conv3d


Project Name: keras-team/keras
Commit Name: 5e797436c3defd2d863ac1ffab11c48dbd42588e
Time: 2018-02-25
Author: me@taehoonlee.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_conv2d