Commit 2cdd1c6
Fix output spec + insert clone for constant_prop_pass. (#11209)
Summary:
In case where a constant propagated node is returned by the exported program, `_validate()` fails with `SpecViolationError` with signature:
```
User output <SOME_CONSTANT_PROP_NODE> is not in the correct order or is not found in the exported program's user_output list.
```
This diff does two things:
1. Update output spec when propagated constants are output of the program.
2. Insert clone op on the constant prop tensor before sending them to output node. This avoid memory planning related errors.
Differential Revision: D754733101 parent 6f9764e commit 2cdd1c6
2 files changed
+62
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
298 | 329 | | |
299 | 330 | | |
300 | 331 | | |
| |||
341 | 372 | | |
342 | 373 | | |
343 | 374 | | |
344 | | - | |
345 | | - | |
346 | | - | |
| 375 | + | |
347 | 376 | | |
348 | 377 | | |
349 | 378 | | |
| 379 | + | |
| 380 | + | |
350 | 381 | | |
351 | 382 | | |
352 | 383 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1025 | 1025 | | |
1026 | 1026 | | |
1027 | 1027 | | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1028 | 1056 | | |
1029 | 1057 | | |
1030 | 1058 | | |
| |||
0 commit comments