c2244d2a4cb5f86968fb117f75469283a19b8a24,tests/keras/backend/backend_test.py,TestBackend,test_sparse_dot,#TestBackend#,1832

Before Change



        W = np.random.random((5, 4))
        // cntk not support it yet
        backends = [KTF]
        if KTH.th_sparse_module:
            // Theano has some dependency issues for sparse
            backends.append(KTH)

        for k in backends:
            t_W = k.variable(W)
            k_s = k.eval(k.dot(k.variable(x_sparse), t_W))
            k_d = k.eval(k.dot(k.variable(x_dense), t_W))

            assert k_s.shape == k_d.shape
            assert_allclose(k_s, k_d, atol=1e-05)

    def test_sparse_concat(self):
        x_d = np.array([0, 7, 2, 3], dtype=np.float32)
        x_r = np.array([0, 2, 2, 3], dtype=np.int64)
        x_c = np.array([4, 3, 2, 3], dtype=np.int64)

After Change


        W = np.random.random((5, 4))
        t_W = K.variable(W)
        k_s = K.eval(K.dot(K.variable(x_sparse), t_W))
        k_d = K.eval(K.dot(K.variable(x_dense), t_W))

        assert k_s.shape == k_d.shape
        assert_allclose(k_s, k_d, atol=1e-05)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: keras-team/keras
Commit Name: c2244d2a4cb5f86968fb117f75469283a19b8a24
Time: 2018-10-21
Author: gabrieldemarmiesse@gmail.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_sparse_dot


Project Name: keras-team/keras
Commit Name: c2244d2a4cb5f86968fb117f75469283a19b8a24
Time: 2018-10-21
Author: gabrieldemarmiesse@gmail.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_sparse_concat


Project Name: keras-team/keras
Commit Name: 874f6db89d70b3c0221034943b2a427d88b63e81
Time: 2018-10-14
Author: gabrieldemarmiesse@gmail.com
File Name: tests/keras/backend/backend_test.py
Class Name: TestBackend
Method Name: test_logsumexp_optim