kevinthesun edited a comment on issue #6594:
URL: https://github.com/apache/incubator-tvm/issues/6594#issuecomment-706467574


   @masahi 
   
   ```
   import tvm  
   from tvm import relay
   
   dtype = "float32"
   branch_a = relay.var("a", shape=(relay.Any(),), dtype=dtype)
   branch_b = relay.var("b", shape=(0,), dtype=dtype)
   cond = relay.var("cond", shape=(), dtype="bool")
   
   out = relay.If(cond, branch_a, branch_b)
   
   mod = tvm.IRModule()
   mod["main"] = relay.Function([cond, branch_a,branch_b], out)
   mod = relay.transform.InferType()(mod)
   print(mod["main"])
   ```
   Will generate
   ```
   fn (%cond: bool, %a: Tensor[(0), float32], %b: Tensor[(0), float32]) -> 
Tensor[(0), float32] {
     if (%cond) {
       %a
     } else {
       %b
     }
   }
   ```
   while input ```a``` should be with shape(?,). There is an issue when 
inferring such an expression.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to