XJDKC commented on a change in pull request #731:
URL: https://github.com/apache/singa/pull/731#discussion_r439708239



##########
File path: python/singa/layer.py
##########
@@ -158,6 +217,21 @@ def _get_unique_name(self):
             self.name = ''
         return self.name

Review comment:
       1. If _get_unqiue_name is called twice, tha layer name will have 
duplicateed substrings.
   2. I think we can't implement like this, we need to set the name after 
calling the __init__. If there is a multi-level 
structure(model->layer1->layer2), the order of function calls is as follows
   * model.\_\_init\_\_
   * layer1.\_\_init\_\_
   * layer2.\_\_init\_\_
   * layer1.\_\_setattr\_\_: the global name of layer1 hasn't been set at this 
time(just a local name), so we can't set the name for layer2.
   * model.\_\_setattr\_\_
   3. I have thought about this, but we may set names for non-parameter 
tensors. If users set a name for a tensor that is not a parameter, this method 
will overwrite the name.




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


Reply via email to