# \[RFC\] Name for non-negative variable

**URL:** <https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392>\
**Category:** RFC\
**Created:** [January 14, 2020, 10:07pm UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392 "2020-01-14T22:07:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yzhliu](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/yzhliu/32/28_2.png) [@yzhliu](https://discuss.tvm.apache.org/u/yzhliu)\
**Post date:** [January 14, 2020, 10:07pm UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392/1 "2020-01-14T22:07:20Z")

</div>

As in this [PR](https://github.com/apache/incubator-tvm/pull/4684) we introduce a new variable to tvm to represent variables which \>= 0, this helps bound inference for floordiv/floormod/etc. We plan to encourage users to use this new type of variable in `tvm.placeholder`, `tvm.compute` etc.

This is a call for the name of the variable, we have choices,

- TIndexVar (T stands for Tensor)
- TensorIndexVar
- ShapeVar (however in Relay, it means multi-dim tuple)
- NonNegVar (could be too limited as we might embed bound in the future)
- BoundedVar (could be too general though)

Please share your thoughts, and welcome new name proposal.

@tqchen @haichen @zhiics @yongwww @ziheng @comaniac @wweic @janimesh

---

<div class="post-metadata">

**Author:** ![comaniac](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/comaniac/32/899_2.png) [@comaniac](https://discuss.tvm.apache.org/u/comaniac)\
**Post date:** [January 14, 2020, 10:21pm UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392/2 "2020-01-14T22:21:25Z")

</div>

In terms of the functionality, `TensorIndexVar` is definitely the clearest one but it’s too long. Maybe `TensorIdxVar` or `NDIdxVar`?

Maybe even just `IdxVar`, if tensor index is the only use case in TVM for indexing.

---

<div class="post-metadata">

**Author:** ![zhiics](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/zhiics/32/146_2.png) [@zhiics](https://discuss.tvm.apache.org/u/zhiics)\
**Post date:** [January 14, 2020, 10:23pm UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392/3 "2020-01-14T22:23:56Z")

</div>

I would say IndexVar or TensorIndexVar. It seems we have `BoundVar` somewhere in the code.

---

<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:** [January 14, 2020, 10:44pm UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392/4 "2020-01-14T22:44:38Z")

</div>

Note that the term `index` could also leads to potential confusions (e.g. whether negative index is allowed in certain cases, of course we do not atm).

NonNeg seems to gives the clearest intention, while shape also indicates the thing is positive. Another alternative could be SizeVar(related to size\_t in c)

---

<div class="post-metadata">

**Author:** ![haichen](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/haichen/32/246_2.png) [@haichen](https://discuss.tvm.apache.org/u/haichen)\
**Post date:** [January 14, 2020, 11:17pm UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392/5 "2020-01-14T23:17:31Z")

</div>

SizeVar or NonNegVar looks good to me. SizeVar probably is better.

---

<div class="post-metadata">

**Author:** ![wweic](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/wweic/32/204_2.png) [@wweic](https://discuss.tvm.apache.org/u/wweic)\
**Post date:** [January 14, 2020, 11:21pm UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392/6 "2020-01-14T23:21:56Z")

</div>

SizeVar and NonNegVar looks good. Also how about RangeVar?

---

<div class="post-metadata">

**Author:** ![ziheng](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/ziheng/32/188_2.png) [@ziheng](https://discuss.tvm.apache.org/u/ziheng)\
**Post date:** [January 15, 2020, 1:40am UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392/7 "2020-01-15T01:40:54Z")

</div>

SizeVar sounds good to me

---

<div class="post-metadata">

**Author:** ![yzhliu](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/yzhliu/32/28_2.png) [@yzhliu](https://discuss.tvm.apache.org/u/yzhliu)\
**Post date:** [January 15, 2020, 1:56am UTC](https://discuss.tvm.apache.org/t/rfc-name-for-non-negative-variable/5392/8 "2020-01-15T01:56:13Z")

</div>

Thanks everyone, seems we can go with SizeVar. I’ll update the pull request accordingly.
