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 2022/05/03 01:10:57 UTC

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

kovtun77 commented on code in PR #15839:
URL: https://github.com/apache/incubator-mxnet/pull/15839#discussion_r863305436


##########
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] or self._flags[0]):

Review Comment:
   `self._flags = list(kwargs.items())`
   The condition is true even when it is not supposed to be. For example if
   `self._flags = [('static_alloc', False), ('static_shape', False), ('inline_limit', 2)]`



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

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org