eric-haibin-lin commented on a change in pull request #10371: [MXNET-263] [WIP]
Support for dot(dns, csr) = dns and dot(dns, csr.T) = dns on GPU
URL: https://github.com/apache/incubator-mxnet/pull/10371#discussion_r182914587
##########
File path: tests/python/unittest/test_sparse_operator.py
##########
@@ -1286,15 +1309,48 @@ def test_sparse_dot_zero_output(lhs_shape, trans_lhs,
rhs_num_cols):
test_dot_csr(lhs_shape, (lhs_shape[1], rnd.randint(5, 10)), 'default',
False, lhs_d, rhs_d) # test gpu SpMM
test_dot_csr(lhs_shape, (lhs_shape[0], rnd.randint(5, 10)), 'default',
True, lhs_d, rhs_d) # (scalar kernel)
test_dot_dns_csr(lhs_shape, (lhs_shape[1], rnd.randint(50, 200)),
lhs_d, lhs_d)
+ test_dot_dns_csr(lhs_shape, (rnd.randint(50, 200), lhs_shape[1]),
lhs_d, lhs_d, trans_rhs=True)
for rhs_d in density:
test_dot_csr(lhs_shape, (lhs_shape[1], rnd.randint(1, 10)),
'row_sparse', False, lhs_d, rhs_d)
test_dot_csr(lhs_shape, (lhs_shape[0], rnd.randint(1, 10)),
'row_sparse', True, lhs_d, rhs_d)
-
+ test_infer_forward_stype(lhs_shape, (lhs_shape[1], rnd.randint(10,
20)),
+ lhs_d, rhs_d, False, False)
+ test_infer_forward_stype(lhs_shape, (rnd.randint(10, 20),
lhs_shape[1]),
+ lhs_d, rhs_d, False, True)
+ test_infer_forward_stype(lhs_shape, (lhs_shape[0], rnd.randint(10,
20)),
+ lhs_d, rhs_d, True, False)
+ test_infer_forward_stype(lhs_shape, (rnd.randint(10, 20),
lhs_shape[0]),
+ lhs_d, rhs_d, True, True)
test_sparse_dot_zero_output(rand_shape_2d(50, 200), False, 40)
test_sparse_dot_zero_output(rand_shape_2d(50, 200), True, 40)
+@with_seed()
+def test_sparse_dot_determinism():
+ def test_dot_determinism(lhs_stype, rhs_stype, lhs_density, rhs_density,
transpose_a, transpose_b):
+ lhs_row = rnd.randint(200, 400)
Review comment:
an int between 200 and 400 seems too large for unit test. Maybe just choose
between 50 and 100?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services