Commit 7f1e331
Make SymInt constructor explicit
Since we plan to have a bunch of code that is sensitive to whether or not a SymInt contains a symbolic shape or not, it seems like a bad idea to have an implicit constructor. For example, code like: ``` sizes_and_strides_.stride_at_unchecked(dim) = 0; ``` would sail through, and the `0` would get implicitly promoted to a SymInt. This is a tradeoff though: it makes code that handles `SymInt`s more clunky as `int64_t`s and integer literals need to be explicitly wrapped in `SymInt` before being used. Pull Request resolved: pytorch#77666 Approved by: https://github.com/ezyang1 parent c673696 commit 7f1e331
File tree
3 files changed
+6
-4
lines changed- c10/core
- test/cpp/jit
- torch/csrc/utils
3 files changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1386 | 1386 | | |
1387 | 1387 | | |
1388 | 1388 | | |
1389 | | - | |
| 1389 | + | |
1390 | 1390 | | |
1391 | 1391 | | |
1392 | 1392 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
637 | 637 | | |
638 | 638 | | |
639 | 639 | | |
640 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
641 | 643 | | |
642 | 644 | | |
643 | 645 | | |
| |||
0 commit comments