You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@singa.apache.org by wa...@apache.org on 2019/08/19 01:41:09 UTC

[incubator-singa] branch master updated: SINGA-478 Improve __itruediv__ in tensor.py

This is an automated email from the ASF dual-hosted git repository.

wangwei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-singa.git


The following commit(s) were added to refs/heads/master by this push:
     new c762bb6  SINGA-478 Improve __itruediv__ in tensor.py
     new 15b6520  Merge pull request #523 from chrishkchris/SINGA-478
c762bb6 is described below

commit c762bb6641f8ffd414dd37839136634a79d616f9
Author: chrishkchris <38...@users.noreply.github.com>
AuthorDate: Sat Aug 17 11:02:09 2019 +0800

    SINGA-478 Improve __itruediv__ in tensor.py
---
 python/singa/tensor.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/singa/tensor.py b/python/singa/tensor.py
index 160b342..bf764f7 100755
--- a/python/singa/tensor.py
+++ b/python/singa/tensor.py
@@ -475,9 +475,9 @@ class Tensor(object):
             x (float or Tensor):
         '''
         if isinstance(x, Tensor):
-            self.data *= (1.0/x.data)
+            self.data /= x.data
         else:
-            self.data *= (1.0/float(x))
+            self.data /= float(x)
         return self
 
     '''