MCPcopy Create free account
hub / github.com/apache/tvm / _wrap_inline_arg_tuple

Function _wrap_inline_arg_tuple

python/tvm/relax/op/base.py:70–92  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

68
69
70def _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
95def call_tir(

Callers 9

call_tirFunction · 0.85
call_tir_with_gradFunction · 0.85
call_tir_inplaceFunction · 0.85
call_dps_packedFunction · 0.85
call_py_funcFunction · 0.85
call_builtin_with_ctxFunction · 0.85
make_closureFunction · 0.85
invoke_closureFunction · 0.85
invoke_pure_closureFunction · 0.85

Calls 1

convert_to_exprFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…