dcslin commented on a change in pull request #570: Tensor naming convention 
review
URL: https://github.com/apache/singa/pull/570#discussion_r365661849
 
 

 ##########
 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:
   thanks for the review, this is fixed

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to