From 42beccc4d1c3db49f6f9088aaca3b772a773f6fc Mon Sep 17 00:00:00 2001 From: reminisce Date: Wed, 28 Jun 2017 11:10:07 -0700 Subject: [PATCH] Remove unnecessary test code --- tests/python/unittest/test_sparse_operator.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/python/unittest/test_sparse_operator.py b/tests/python/unittest/test_sparse_operator.py index 5335b3d6c3b4..a41beb7e5937 100644 --- a/tests/python/unittest/test_sparse_operator.py +++ b/tests/python/unittest/test_sparse_operator.py @@ -121,19 +121,13 @@ def test_dot_csr(lhs_shape, rhs_shape, rhs_stype, trans_lhs): # test symbolic forward lhs = mx.symbol.Variable('lhs', storage_type='csr') rhs = mx.symbol.Variable('rhs', storage_type=rhs_stype) - dns_zeros = mx.symbol.Variable('dns') test = mx.symbol.dot(lhs, rhs, transpose_a=trans_lhs) - # TODO(junwu): since sparse operator does not support sparse ograd as input for backward, - # we have to add the dot sparse output to a zero dense matrix to generate a dense matrix - # as the final output. In the future, we will evaluate the necessity of supporting - # sparse ograd as input for the backward pass. - test = mx.symbol.elemwise_add(test, dns_zeros) - location = {'lhs': lhs_nd, 'rhs': rhs_nd, 'dns': mx.nd.zeros(out.shape)} + location = {'lhs': lhs_nd, 'rhs': rhs_nd} expected = {'rhs': rhs_backward_grad} check_symbolic_forward(test, location, [out_np], rtol=1e-3, atol=1e-4) # test symbolic backward check_symbolic_backward(test, location, [out_np], expected, - grad_req={'lhs': 'null', 'rhs': 'write', 'dns': 'null'}, + grad_req={'lhs': 'null', 'rhs': 'write'}, rtol=1e-3, atol=1e-4) lhs_shape = rand_shape_2d()