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/09/17 21:47:55 UTC

[GitHub] [incubator-mxnet] rahul003 commented on a change in pull request #15839: Add register_op_hook for gluon

rahul003 commented on a change in pull request #15839: Add register_op_hook for gluon
URL: https://github.com/apache/incubator-mxnet/pull/15839#discussion_r325399680
 
 

 ##########
 File path: python/mxnet/gluon/block.py
 ##########
 @@ -833,6 +848,12 @@ def _deferred_infer_shape(self, *args):
     def _call_cached_op(self, *args):
         if self._cached_op is None:
             self._build_cache(*args)
+        assert self._cached_op, "cached op is not None"
+        if self._callback:
+            self._cached_op._register_op_hook(self._callback, self._monitor_all)
+            if len(self._flags) >= 2 and self._flags[1]:
+                warnings.warn("Callback is not supported when static_shape=True "
 
 Review comment:
   Why's this? If it's not supported, do not register the callback?

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