Commit 161049e
authored
[Relax][PyTorch] Enhance handling of unbounded upper bound constraints (#18489)
## Why
PyTorch uses int_oo (IntInfinity) for unbounded constraints, which would
make our current implemenation crash
## How
- Update the type hint for `create_input_vars` to allow for optional
upper bounds.
- Modify the logic to handle unbounded constraints by setting upper
bounds to None when applicable.
- Add a new test case1 parent ced7181 commit 161049e
File tree
2 files changed
+45
-4
lines changed- python/tvm/relax/frontend/torch
- tests/python/relax
2 files changed
+45
-4
lines changedLines changed: 15 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1383 | 1383 | | |
1384 | 1384 | | |
1385 | 1385 | | |
1386 | | - | |
| 1386 | + | |
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | 1392 | | |
1393 | 1393 | | |
| 1394 | + | |
| 1395 | + | |
1394 | 1396 | | |
1395 | 1397 | | |
1396 | 1398 | | |
| 1399 | + | |
1397 | 1400 | | |
1398 | | - | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
1399 | 1404 | | |
1400 | 1405 | | |
1401 | 1406 | | |
| |||
1472 | 1477 | | |
1473 | 1478 | | |
1474 | 1479 | | |
1475 | | - | |
1476 | | - | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
1477 | 1485 | | |
1478 | 1486 | | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
1479 | 1490 | | |
1480 | 1491 | | |
1481 | 1492 | | |
| |||
Lines changed: 30 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7206 | 7206 | | |
7207 | 7207 | | |
7208 | 7208 | | |
| 7209 | + | |
7209 | 7210 | | |
7210 | 7211 | | |
7211 | 7212 | | |
| |||
7909 | 7910 | | |
7910 | 7911 | | |
7911 | 7912 | | |
| 7913 | + | |
| 7914 | + | |
| 7915 | + | |
| 7916 | + | |
| 7917 | + | |
| 7918 | + | |
| 7919 | + | |
| 7920 | + | |
| 7921 | + | |
| 7922 | + | |
| 7923 | + | |
| 7924 | + | |
| 7925 | + | |
| 7926 | + | |
| 7927 | + | |
| 7928 | + | |
| 7929 | + | |
| 7930 | + | |
| 7931 | + | |
| 7932 | + | |
| 7933 | + | |
| 7934 | + | |
| 7935 | + | |
| 7936 | + | |
| 7937 | + | |
| 7938 | + | |
| 7939 | + | |
| 7940 | + | |
7912 | 7941 | | |
7913 | 7942 | | |
7914 | 7943 | | |
| |||
7955 | 7984 | | |
7956 | 7985 | | |
7957 | 7986 | | |
| 7987 | + | |
7958 | 7988 | | |
7959 | 7989 | | |
7960 | 7990 | | |
| |||
0 commit comments