How can I transfer a list of functions?

I’m trying to pass a list of functions from Python to C++. However, this doesn’t seem possible at the moment because tvm::Array can only contain objects deriving from ObjectRef (which PackedFunc does not). Is there another approach I can take? In particular, it’s important that the order of the functions is maintained.

Thanks!

I’ve found out I can do this by just passing each function as it’s own argument and then collecting them together from TVMArgs.

What you described certainly works and is the approach we used so far :slight_smile: Depending on the demand, we can also start to think about making PackedFunc as a sub-class of an ObjectRef

1 Like