Passing a tuple to a packed func?

Hello everyone,

I was wondering if there is a way to pass a tuple (or array) directly to a packed func.

tpl = tuple(1,2,3)
tvm.tir.call_packed("func_name", tpl)

Reading the packed_func documentation, I don’t see a specific mention of a tuple being a valid input argument type. Nonetheless, it states that “TVM Object to represent any object in IR” would be allowed.

I found that there is a tir.tvm_tuple, but when I try to use it from a python script I get the following error:

AttributeError: module 'tvm.tir' has no attribute 'tvm_tuple'

In the codebase, I only see 2 python examples of the tvm_tuple being used.

  1. In the TIR transform pipeline of VTA. But its being called inside a tvm.call_intrinsic.
  2. In a testing script. But here it is being used inside of hybrid script, which for some reason doesnt throw the error. (Actually if I set a breakpoint there, I cant stop the execution there)

Thanks

In TVM, a tuple corresponds to tvm::runtime::Array - so I am not sure if it is well supported in codegen.

Thanks for your response, but I still dont understand what the solution is… except for decomposing the tuple into elementary arguments.