I wrote some ops with te and topi, and found that when using te.var to represent op input shape,it became much slower than constant shape,when with the same schedule.
When I look into the generated cuda code, there are lots of if sentences about the var,which make it much slower.So I wonder if there is a way to get rid of those if sentences,because I think most of them are useless.Maybe some assertion? But how to add assertion in TE?
I guess what you are seeing are potential cases when the variable can have any value in the range of the data type you selected and therefore for correctness all those if statements are necessary?
Any reason you want to use te.var ? I am guessing due to some dynamic shape you want to support, but I think the TVM standard way of doing this is to JIT each time the values changed.