[DISCUSS] Runtime Array Containers Array/ADT/String

Follow up PR for runtime::Array: https://github.com/apache/incubator-tvm/pull/5585

1 Like

Follow up PR for runtime::Map: https://github.com/apache/incubator-tvm/pull/5740

Hi, can I use StringList or Map<String, String> in Relay? example ?

My impression is that one drawback of this switch is that in the Python interface, a lot of conversions to standard types seem to be needed. When using shapes outside of TVM, one has to convert Arrays of IntImm to lists of int. Even when feeding shapes back to TVM I seem to need a lot of list(…) casting. (And certainly when I want to use list manipulations.)

Now, I’m not sure what the best way of action is, but I sometimes wish that we could just convert to standard Python objects when we hand them out (although I recognize that this might be a lossy conversion).

Best regards

Thomas

1 Like

As an alternative, we can try to add enough overloads to make sure that the object itself behave like an list and number so such cast is not necessary. We have already done that for string(by having String to subclass str)

1 Like

I think you can just write Map<String, String> or Array<String>. Let me know if any issues occurred :slight_smile:

1 Like

Thank you very much for answering. Can I use in this way: a = relay.var("a", MapType); b = a["key"];? Please correct me if there is any mistake.

Unfortunately no, it is right now in runtime, not IR…

Are there any plans to support these features in IR?