haojin2 commented on a change in pull request #10208: [MXNET-117] Sparse 
operator broadcast_mul/div(csr, dense) = csr
URL: https://github.com/apache/incubator-mxnet/pull/10208#discussion_r179052586
 
 

 ##########
 File path: tests/python/unittest/test_sparse_operator.py
 ##########
 @@ -1675,6 +1675,27 @@ def check_sparse_embedding(in_dim, out_dim, batch, 
densities, deterministic):
     check_sparse_embedding(in_dim, out_dim, batch, densities, False)
 
 
+@with_seed()
+def test_sparse_broadcast_mul_div():
+    def check_broadcast_mul(mx_lhs, mx_rhs, np_lhs, np_rhs, dtype):
+        assert_almost_equal(mx.nd.sparse.multiply(mx_lhs, mx_rhs).asnumpy(), 
np.multiply(np_lhs, np_rhs), atol=1e-4)
+    def check_broadcast_div(mx_lhs, mx_rhs, np_lhs, np_rhs, dtype):
+        assert_almost_equal(mx.nd.sparse.divide(mx_lhs, mx_rhs).asnumpy(), 
np.divide(np_lhs, np_rhs), atol=1e-4)
+    stype = 'csr'
+    for num_rows in range(2, 6):
 
 Review comment:
   Sure, done

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to