# \[DISCUSS\] Runtime Array Containers Array/ADT/String

**URL:** <https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582>\
**Category:** RFC\
**Created:** [November 1, 2019, 9:17pm UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582 "2019-11-01T21:17:50Z")\
**Posts on this page:** 10\
**Page:** 3

<div class="post-metadata">

**Author:** ![junrushao](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/junrushao/32/205_2.png) [@junrushao](https://discuss.tvm.apache.org/u/junrushao)\
**Post date:** [May 15, 2020, 3:08am UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/41 "2020-05-15T03:08:52Z")

</div>

Follow up PR for `runtime::Array`: [https://github.com/apache/incubator-tvm/pull/5585](https://github.com/apache/incubator-tvm/pull/5585)

---

<div class="post-metadata">

**Author:** ![junrushao](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/junrushao/32/205_2.png) [@junrushao](https://discuss.tvm.apache.org/u/junrushao)\
**Post date:** [June 8, 2020, 8:04am UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/42 "2020-06-08T08:04:52Z")

</div>

Follow up PR for `runtime::Map`: [https://github.com/apache/incubator-tvm/pull/5740](https://github.com/apache/incubator-tvm/pull/5740)

---

<div class="post-metadata">

**Author:** ![xiandi](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/xiandi/32/1918_2.png) [@xiandi](https://discuss.tvm.apache.org/u/xiandi)\
**Post date:** [June 24, 2020, 9:47am UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/43 "2020-06-24T09:47:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![t-vi](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/t-vi/32/1148_2.png) [@t-vi](https://discuss.tvm.apache.org/u/t-vi)\
**Post date:** [June 24, 2020, 2:07pm UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/44 "2020-06-24T14:07:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tqchen](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/tqchen/32/5_2.png) [@tqchen](https://discuss.tvm.apache.org/u/tqchen)\
**Post date:** [June 24, 2020, 2:56pm UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/45 "2020-06-24T14:56:05Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![junrushao](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/junrushao/32/205_2.png) [@junrushao](https://discuss.tvm.apache.org/u/junrushao)\
**Post date:** [June 24, 2020, 6:15pm UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/46 "2020-06-24T18:15:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xiandi](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/xiandi/32/1918_2.png) [@xiandi](https://discuss.tvm.apache.org/u/xiandi)\
**Post date:** [June 28, 2020, 6:27am UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/47 "2020-06-28T06:27:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![junrushao](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/junrushao/32/205_2.png) [@junrushao](https://discuss.tvm.apache.org/u/junrushao)\
**Post date:** [June 28, 2020, 5:37pm UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/48 "2020-06-28T17:37:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xiandi](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/xiandi/32/1918_2.png) [@xiandi](https://discuss.tvm.apache.org/u/xiandi)\
**Post date:** [June 29, 2020, 2:31am UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/49 "2020-06-29T02:31:51Z")

</div>

Are there any plans to support these features in IR?

---

<div class="post-metadata">

**Author:** ![xiandi](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/xiandi/32/1918_2.png) [@xiandi](https://discuss.tvm.apache.org/u/xiandi)\
**Post date:** [August 10, 2020, 3:13pm UTC](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582/50 "2020-08-10T15:13:48Z")

</div>

> **[\[RFC\] Relay Containers Array/Map/String](https://discuss.tvm.apache.org/t/rfc-relay-containers-array-map-string/7560)**
>
> I am a mlsys engineer who mainly provides server support for the nlp-related model for the company. In the nlp-related business scenario, we found that tvm can provide superior tensor computing performance, so we intend to promote tvm applications...

[Previous page](https://discuss.tvm.apache.org/t/discuss-runtime-array-containers-array-adt-string/4582.md?page=2)
