samskalicky commented on a change in pull request #17623: Dynamic subgraph
compile support
URL: https://github.com/apache/incubator-mxnet/pull/17623#discussion_r388529468
##########
File path: python/mxnet/gluon/block.py
##########
@@ -1026,6 +1030,53 @@ def _call_cached_op(self, *args):
out = [out]
return _regroup(out, self._out_format)
+ def optimize_for(self, x, *args, backend=None, backend_opts=None,
**kwargs):
+ """Activates or deactivates :py:class:`HybridBlock` s recursively. Has
no effect on
+ non-hybrid children.
Review comment:
Ya i think i just copied from hybridize's doc string. I'll update this so
its more clear what the function does and refer to hybridize. i'll add
something like we put in the README.md:
> Immediately partitions a HybridBlock using the specified backend. Combines
the work done in the `hybridize` API with part of the work done in the forward
pass without calling the CachedOp. Can be used in place of `hybridize`,
afterwards `export` can be called or inference can be run.
What do you think?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services