singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] dcslin commented on a change in pull request #570: Tensor naming convention review
Date Mon, 13 Jan 2020 06:51:35 GMT
dcslin commented on a change in pull request #570: Tensor naming convention review
URL: https://github.com/apache/singa/pull/570#discussion_r365662228
 
 

 ##########
 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:
   reference https://github.com/apache/singa/pull/570/commits/8cc44683abfb21be284a751f501ba31eb4737022

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