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 2020/10/27 19:40:47 UTC

[GitHub] [incubator-mxnet] mseth10 commented on a change in pull request #18690: Optimize graph execution in presence of dynamic shape op

mseth10 commented on a change in pull request #18690:
URL: https://github.com/apache/incubator-mxnet/pull/18690#discussion_r512978904



##########
File path: python/mxnet/gluon/block.py
##########
@@ -1094,8 +1094,57 @@ def _deferred_infer_shape(self, *args):
             raise ValueError(error_msg)
 
     def _call_cached_op(self, *args):
-        if self._cached_op is None:
+        if not self._cached_op_args or not self._cached_graph:
             self._build_cache(*args)
+
+        if self._first_forward:
+            # partition static shape ops if the graph contains any dynamic shape op
+            self._first_forward = False
+            data, out = self._cached_graph
+            out, is_dynamic = out._optimize_for_dynamic_shape_op(is_np_array(), self._flags)
+            self._cached_graph = data, out

Review comment:
       Right, we forgot to remove this line after the dynamic shape partitioning. Will address it.




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