Skip to content

Commit

Permalink
Fix test_sparse_retain python3 issue (apache#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
reminisce authored and eric-haibin-lin committed Jun 7, 2017
1 parent 39d12bc commit d27027a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tests/python/unittest/test_sparse_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_sparse_retain():
num_rows = shape[0]
rsp, _ = rand_sparse_ndarray(shape=shape, storage_type='row_sparse', density=0.5)
length = np.random.randint(1, num_rows + 1)
idx = random_sample(range(0, num_rows), length)
idx = random_sample(list(range(0, num_rows)), length)
idx.sort()
dns = rsp.asnumpy()
tensor_retained_expected = np.zeros(shape)
Expand All @@ -198,7 +198,6 @@ def test_sparse_retain():
check_numeric_gradient(sym, [rsp, indices], grad_nodes=['data'], grad_stype_dict={'data': 'row_sparse'})



if __name__ == '__main__':
import nose
nose.runmodule()

0 comments on commit d27027a

Please sign in to comment.