Commit 058782c
[torch.export] Rmoving unused constants - add support for corner case (pytorch#165205)
Summary: In some cases unused constant had only one level of child node, no second level of child node. Those constants should be removed too. The added test case has the scenario where this scenario will happen.
Test Plan:
```
buck test mode/opt caffe2/test:test_export -- 'test_unused_constant'
```
https://www.internalfb.com/intern/testinfra/testrun/15481123837456594
Differential Revision: D84398413
Pull Request resolved: pytorch#165205
Approved by: https://github.com/angelayi1 parent 2b4ef6b commit 058782c
File tree
2 files changed
+23
-0
lines changed- test/export
- torch/_export/passes
2 files changed
+23
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1628 | 1628 | | |
1629 | 1629 | | |
1630 | 1630 | | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
1631 | 1649 | | |
1632 | 1650 | | |
1633 | 1651 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
| |||
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
| 163 | + | |
159 | 164 | | |
160 | 165 | | |
161 | 166 | | |
| |||
0 commit comments