Commit d8d28bf
authored
[Relay] Fix TFlite frontend for unpack, stridedslice (#10333)
We found this while converting an RNN model.
The relay tflite frontend use squeeze at converting unpack, but when the
unpack.axis=0, `None` is passed to relay.squeeze(), which would squeeze
all dimensions with length 1, causing different results from TFLite.
A possible fix might be, assign the unpack.axis as-is to relay.squeeze()
As for stridedslice, when the tflite frontend handles shrink_axis_mask,
the wrapped `begin` should be used, instead of the original one which
can be negative. It can cause errors at
https://github.com/apache/tvm/blob/d65ff6594d4d6db0062537a1d43c0504173b8e5c/include/tvm/topi/detail/strided_slice.h#L140
Related cases are also added to the python test.1 parent 5a22c56 commit d8d28bf
File tree
2 files changed
+10
-4
lines changed- python/tvm/relay/frontend
- tests/python/frontend/tflite
2 files changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1667 | 1667 | | |
1668 | 1668 | | |
1669 | 1669 | | |
1670 | | - | |
| 1670 | + | |
1671 | 1671 | | |
1672 | 1672 | | |
1673 | 1673 | | |
| |||
2705 | 2705 | | |
2706 | 2706 | | |
2707 | 2707 | | |
2708 | | - | |
2709 | | - | |
2710 | | - | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
2711 | 2711 | | |
2712 | 2712 | | |
2713 | 2713 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
618 | 618 | | |
619 | 619 | | |
620 | 620 | | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
621 | 624 | | |
622 | 625 | | |
623 | 626 | | |
| |||
3186 | 3189 | | |
3187 | 3190 | | |
3188 | 3191 | | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
3189 | 3195 | | |
3190 | 3196 | | |
3191 | 3197 | | |
| |||
0 commit comments