thomelane commented on a change in pull request #15365: [TUTORIAL] Revise Naming tutorial URL: https://github.com/apache/incubator-mxnet/pull/15365#discussion_r297438333
########## File path: docs/tutorials/gluon/naming.md ########## @@ -137,16 +116,11 @@ print(model1.dense1.prefix) print(model1.mydense.prefix) ``` - model1_ - model1_dense0_ - model1_dense1_ - model1_mydense_ - - -**It is recommended that you manually specify a prefix for the top level Block, i.e. `model = Model(prefix='mymodel_')`, to avoid potential confusions in naming.** +Note that `model1.dense0` is still named as `dense0_` instead of `dense2_`, following `Dense` layers in previously created `model0`. This is because each instance of model's name scope is independent of each other. -The same principle also applies to container blocks like Sequential. `name_scope` can be used inside `__init__` as well as out side of `__init__`: +**It is recommended that you manually specify a prefix for the top level `Block`, i.e. `model = Model(prefix='mymodel_')`, to avoid potential confusion in naming.** +The same principle applies to container blocks like [`Sequential`](https://mxnet.incubator.apache.org/versions/master/api/python/gluon/gluon.html#mxnet.gluon.nn.Sequential). `name_scope` can be used inside as well as outside of `__init__`: Review comment: Can tell whether you're saying this is recommended or not? Using name scope with Sequential? ---------------------------------------------------------------- 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
