singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] nudles commented on a change in pull request #570: Tensor naming convention review
Date Wed, 01 Jan 2020 07:32:24 GMT
nudles commented on a change in pull request #570: Tensor naming convention review
URL: https://github.com/apache/singa/pull/570#discussion_r362307508
 
 

 ##########
 File path: python/singa/tensor.py
 ##########
 @@ -232,14 +232,18 @@ def l1(self):
         '''
         return self.data.L1()
 
-    def set_value(self, x):
+    def set_value(self, x, inplace=True):
         '''Set all elements of the tensor to be the give value.
 
         Args:
             x (float), a float value to be set to all elements.
         '''
         # assert type(x) == float, 'set value only accepts float input'
         # if isinstance(x, float):
+        if not inplace:
+            # return new tensor filled with value
+            raise NotImplementedError
+
         self.data.SetFloatValue(float(x))
 
 Review comment:
   return self if inplace is false; otherwise, return the new tensor?
   

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