Commit 72d542e
authored
[Bugfix][ONNX] Skip constant If node generated by PyTorch (#17383)
* [Bugfix][VTA] Fix FSIM compile error on macOS.
VTA FSIM could not be built on macOS, for it leverages malloc.h and
memalign, yet both have been deprecated and are not provided by
macOS. This issue was captured in #13173.
This commit stops including malloc.h in VTA Runtime as stdlib.h has
provided functions we need.
This commit uses posix_memalign instead of memalign. It is a portable standard function.
* Fix format.
* [Bugfix][ONNX] Skip constant If node generated by PyTorch
This commit adds a check for If nodes for ONNX frontend of Relay
to skip the broadcast if the predicate is constant.
Sometimes PyTorch to ONNX inserts silly if nodes that produce dynamic
ranks, and ONNX frontend of TVM would broadcast the lower dimensions
between branches, which is irrational for some cases, e.g. 5×5×3×4 to
5×5×3×4×1. The predicate of silly if might be constant and reasonable
to skip to avoid the broadcast problem.
This issue was captured in #16898.
* Fix format.1 parent 425e15b commit 72d542e
1 file changed
+18
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4565 | 4565 | | |
4566 | 4566 | | |
4567 | 4567 | | |
| 4568 | + | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
| 4572 | + | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
| 4577 | + | |
| 4578 | + | |
| 4579 | + | |
| 4580 | + | |
| 4581 | + | |
| 4582 | + | |
| 4583 | + | |
| 4584 | + | |
4568 | 4585 | | |
4569 | 4586 | | |
4570 | 4587 | | |
| |||
6529 | 6546 | | |
6530 | 6547 | | |
6531 | 6548 | | |
| 6549 | + | |
6532 | 6550 | | |
6533 | 6551 | | |
6534 | 6552 | | |
| |||
0 commit comments