singa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [singa] XJDKC commented on a change in pull request #731: fix the bug of param name
Date Sat, 13 Jun 2020 04:34:54 GMT

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 of 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:
users@infra.apache.org



Mime
View raw message