Commit 327b6b7
Notify failure during torch-to-tosa when AtenEmptyMemoryFormat receives a tensor with a dimension of size zero (#4353)
The lowering for `torch.aten.empty.memory_format` produces a
non-conformant `tosa.const` when the output `!torch.vtensor` has a
zero-sized dimension. This fix detects this case and reports a failure,
preventing the generation of invalid IR. This issue was first observed
in the SAM2 image predictor model.
Co-authored-by: Hariprasad Ravishankar <[email protected]>1 parent 900d90b commit 327b6b7
File tree
2 files changed
+19
-0
lines changed- lib/Conversion/TorchToTosa
- test/Conversion/TorchToTosa
2 files changed
+19
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6435 | 6435 | | |
6436 | 6436 | | |
6437 | 6437 | | |
| 6438 | + | |
| 6439 | + | |
| 6440 | + | |
| 6441 | + | |
| 6442 | + | |
6438 | 6443 | | |
6439 | 6444 | | |
6440 | 6445 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4370 | 4370 | | |
4371 | 4371 | | |
4372 | 4372 | | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
| 4377 | + | |
| 4378 | + | |
| 4379 | + | |
| 4380 | + | |
| 4381 | + | |
| 4382 | + | |
| 4383 | + | |
| 4384 | + | |
| 4385 | + | |
| 4386 | + | |
0 commit comments