xhmelon commented on issue #16898:
URL: https://github.com/apache/tvm/issues/16898#issuecomment-2353212324

   Hi @shaoyuyoung , 
   The output shape from the then branch is `5 × 5 × 3 × 4`, while the else 
branch is `5 × 5 × 3 × 4 × 1`. The ONNX frontend in TVM attempts to broadcast 
the lower dimensions between these branches, which is irrational for our case. 
Since the predicate is a constant True, I added a check to skip the broadcast 
when the predicate is constant. This workaround resolves the issue in our case, 
but the source of the test case is still important. 
   The comment in the broadcast code explains:
   ```
   # Sometimes pytorch to onnx will insert silly if statements that produce 
dynamic ranks.
   # Often these dont contribute anything. If we see a dynamic rank output, try 
to unify
   # them so we can continue without breaking.
   ``` 
   I’m wondering whether this behavior is automatically generated by PyTorch, 
as suggested in the comment, or if it’s designed intentionally. 


-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to