singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-singa] ShichengChen commented on a change in pull request #508: SINGA-474 transpose operator
Date Wed, 14 Aug 2019 11:55:04 GMT
ShichengChen commented on a change in pull request #508: SINGA-474 transpose operator
URL: https://github.com/apache/incubator-singa/pull/508#discussion_r313835555
 
 

 ##########
 File path: test/python/test_operation.py
 ##########
 @@ -992,18 +992,55 @@ 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_transpose_cpu(self):
+        x = np.array([0.1,-1.0,0.4,4.0,-0.9,9.0]).reshape(3,2,1).astype(np.float32)
+        y = x.transpose(1,2,0)
+        dy = np.ones(y.shape, dtype = np.float32)
+        grad = np.ones((3,2,1), dtype = np.float32)
 
 Review comment:
   I just changed my wrong code.
   grad is dx and I used transpose for 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

Mime
View raw message