You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@singa.apache.org by GitBox <gi...@apache.org> on 2019/08/14 01:58:42 UTC

[GitHub] [incubator-singa] nudles commented on a change in pull request #506: SINGA-474 mul operator

nudles commented on a change in pull request #506: SINGA-474 mul operator
URL: https://github.com/apache/incubator-singa/pull/506#discussion_r313678756
 
 

 ##########
 File path: test/python/test_operation.py
 ##########
 @@ -991,7 +991,57 @@ def test_Sqrt_gpu(self):
 
         np.testing.assert_array_almost_equal(tensor.to_numpy(result), XT, decimal=5)
         np.testing.assert_array_almost_equal(tensor.to_numpy(tensor.from_raw_tensor(dx)), DX, decimal=5)
-    
+
+
+
+    def test_mul_cpu(self):
+        x = np.array([0.1,-1.0,0.4,4.0,-0.9,9.0]).reshape(3,2).astype(np.float32)
+        x1 = np.array([0.1,1.0,0.4,4.0,0.9,9.0]).reshape(3,2).astype(np.float32)
+        y = x*x1
+        dy = np.ones((3, 2), dtype = np.float32)
+        grad0=x1
 
 Review comment:
   grade0 should be x1*dy?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services