Helper function to wrap argument tuple Normalize the arguments provided the functions that accept a tuple of arguments, and require the tuple of arguments to be written in-line. If the arguments provided are a single relax expression, and are not a reference to a relax tuple, then
(args)
| 68 | |
| 69 | |
| 70 | def _wrap_inline_arg_tuple(args) -> Expr: |
| 71 | """Helper function to wrap argument tuple |
| 72 | |
| 73 | Normalize the arguments provided the functions that accept a tuple |
| 74 | of arguments, and require the tuple of arguments to be written |
| 75 | in-line. If the arguments provided are a single relax expression, |
| 76 | and are not a reference to a relax tuple, then wrap them into an |
| 77 | in-line relax Tuple. |
| 78 | |
| 79 | """ |
| 80 | if isinstance(args, tuple | list): |
| 81 | return tvm.relax.Tuple([convert_to_expr(a) for a in args]) |
| 82 | elif ( |
| 83 | isinstance(args, Expr) |
| 84 | and not isinstance(args, tvm.relax.Tuple) |
| 85 | and ( |
| 86 | args.struct_info_ is None |
| 87 | or not isinstance(args.struct_info_, tvm.relax.TupleStructInfo) |
| 88 | ) |
| 89 | ): |
| 90 | return tvm.relax.Tuple([args]) |
| 91 | else: |
| 92 | return args |
| 93 | |
| 94 | |
| 95 | def call_tir( |
no test coverage detected
searching dependent graphs…