singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-singa] pinpom commented on a change in pull request #487: SINGA -475 add Log operator to singa
Date Fri, 02 Aug 2019 05:48:41 GMT
pinpom commented on a change in pull request #487: SINGA -475 add Log operator to singa
URL: https://github.com/apache/incubator-singa/pull/487#discussion_r309989672
 
 

 ##########
 File path: test/python/test_operation.py
 ##########
 @@ -610,6 +610,18 @@ def test_Atanh_gpu(self):
         np.testing.assert_array_almost_equal(tensor.to_numpy(result), XT, decimal=5)
         self.check_shape(dx.shape(), (3, 2))
 
+    def test_Log(self):
+        X=np.array([1, np.e, np.e**2, np.e**4]).reshape(2,2).astype(np.float32)
+        XT=np.log(X)
+        x=tensor.from_numpy(X)
+        x.to_device(gpu_dev)
+
+        result=autograd.log(x)
+        dx=result.creator.backward(x.data)
+
+        np.testing.assert_array_almost_equal(tensor.to_numpy(result), XT)
 
 Review comment:
   added backward test.

----------------------------------------------------------------
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