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/07/17 17:19:27 UTC

[GitHub] [incubator-mxnet] waytrue17 commented on a change in pull request #18690: [WIP] optimize graph in presence of dynamic shape ops

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



##########
File path: python/mxnet/symbol/symbol.py
##########
@@ -2627,6 +2628,15 @@ def detach(self):
     def backward(self):
         raise NotImplementedForSymbol(self.backward, None)
 
+    def optimize_for_dynamic_shape_op(self):
+        """Check if any dynamic shape op presents in the symbol, if yes, partition all static shape ops for optimization
+        returns the optimized symbol.
+        """
+        out = SymbolHandle()
+        check_call(_LIB.MXOptimizeForDynamicShapeOp(self.handle, ctypes.byref(out)))
+        from .numpy import _Symbol as np_symbol

Review comment:
       I tried to put it on the top. It causes import loop error

##########
File path: python/mxnet/symbol/symbol.py
##########
@@ -1470,6 +1470,10 @@ def optimize_for(self, backend, args=None, aux=None, ctx=None,
         ctx : Context, optional
             Device context, used to infer stypes
 
+        is_np_sym : boolean, optional
+            Output symbol type
+            - If true, output type is np symbol, otherwise nd symbol.
+

Review comment:
       Will be changing it

##########
File path: python/mxnet/symbol/symbol.py
##########
@@ -2627,6 +2633,24 @@ def detach(self):
     def backward(self):
         raise NotImplementedForSymbol(self.backward, None)
 
+    def optimize_for_dynamic_shape_op(self, is_np_sym=False):

Review comment:
       Will change to private function




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