szha commented on a change in pull request #17376: [MXNET-1404] Implement storage tagging, the first half of the memory profiler URL: https://github.com/apache/incubator-mxnet/pull/17376#discussion_r371607120
########## File path: python/mxnet/gluon/block.py ########## @@ -53,18 +54,24 @@ def __init__(self, block): @staticmethod def create(prefix, params, hint): - """Creates prefix and params for new `Block`.""" + """ + Creates prefix, params, and profiler scope name for new `Block`. + The profiler scope is to support the GPU memory profiler. + """ current = getattr(_BlockScope._current, "value", None) if current is None: if prefix is None: if not hasattr(_name.NameManager._current, "value"): _name.NameManager._current.value = _name.NameManager() prefix = _name.NameManager._current.value.get(None, hint) + '_' + # replace the trailing underscore with colon + profiler_scope_name = (prefix[:-1] if prefix.endswith('_') \ Review comment: from the logic below, it looks like prefix can still be None, which doesn't have `.endswith` ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services