You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/03/14 00:19:49 UTC

[GitHub] [incubator-mxnet] szha commented on a change in pull request #14423: Add repr for SymbolBlock

szha commented on a change in pull request #14423: Add repr for SymbolBlock
URL: https://github.com/apache/incubator-mxnet/pull/14423#discussion_r265381261
 
 

 ##########
 File path: python/mxnet/gluon/block.py
 ##########
 @@ -1024,6 +1024,11 @@ def imports(symbol_file, input_names, param_file=None, ctx=None):
             ret.collect_params().load(param_file, ctx=ctx)
         return ret
 
+    def __repr__(self):
+        s = '{name}(\n{modstr}\n)'
+        modstr = '\n'.join(['{block}'.format(block=self.__dict__['_cached_graph'][-1])])
 
 Review comment:
   why use `__dict__`? or -1 index?

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


With regards,
Apache Git Services