rohanmukh commented on a change in pull request #6905:
URL: https://github.com/apache/incubator-tvm/pull/6905#discussion_r522653603
##########
File path: python/tvm/relay/op/contrib/tensorrt.py
##########
@@ -152,13 +153,50 @@ def partition_for_tensorrt(
with tvm.transform.PassContext(opt_level=3,
config={"relay.ext.tensorrt.options": config}):
mod = seq(mod)
mod = prune_tensorrt_subgraphs(mod)
+
return mod, config
+def check_dynamism(args, op_name):
+ """
+ Check for dynamism inside any of the args in the op.
+
+ Parameters
+ ----------
+ args : tvm.ir.container.Array
+ Arguments of the op. Each of the argument shape is checked for
presence of dynamic
+ components.
+ op_name: str
+ Name of the op for debugging purposes only.
+ Returns
+ ----------
+ ret : bool
+ True if dynamism is present, False otherwise
+ """
+ for arg in args:
+ if isinstance(arg, (Call, Var, Constant, TupleGetItem)):
+ for dim_shape in arg.checked_type.shape:
Review comment:
` elif isinstance(arg, Tuple):
return check_dynamism(arg.fields, op_name)`
Hi @zhiics , thanks for the comments. For this particular issue, the next
two lines in the code is as above. If the arg is a nested Tuple, it does get
recursively called and its args get checked for dynamism. Let me know if there
is something else I am missing here.
----------------------------------------------------------------
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]