Hi all, I understand that there are two kinds of dynamic shape issues:
- the output shape can be inferred from the input shape.
In this case, a tvm.tir.Var can be used as a symbolic dim.The symbolic dim can be then used to represent other shape shapes, which can be inferred from the actual shape of the input during runtime. (ps: i use tvm v0.8.0 currently)
This scenario can be handled by TVM.
- the output shape is determined by the actual input content rather than the shape of the input.
For example, in a TensorFlow graph, a sparse tensor can be represented by three input placeholders: dense_shape
(whose shape is [2]), values
, and indices
. I want to perform some processing on the values
and then replenish them based on indices
into a tensor of shape dense_shape
. I only know that the dimension of dense_shape
is 2, but I cannot know its specific value before run, and therefore I am not sure what the shape of the output will be.
I try to use IRBuilder to build graph directly to express the same graph semantic as tensorflow graph.
Can this scenario be handled by tvm? If I use two symbolic tvm.tir.Var to represent dense_shape
, how could I let tvm known that these two Var should be assigned to the value of actual input content of dense_shape
with IRBuilder?
Thanks a lot