Commit 34ec924
committed
Fix L1Loss when target.requires_grad is True.
L1Loss had a completely different (and incorrect, see #43228) path when target.requires_grad was True.
This PR does the following:
1) adds derivative support for target via the normal derivatives.yaml route
2) kill the different (and incorrect) path for when target.requires_grad was True
3) modify the L1Loss CriterionTests to verify that the target derivative is checked.
ghstack-source-id: c8664d9
Pull Request resolved: #444711 parent 3849a07 commit 34ec924
File tree
3 files changed
+8
-11
lines changed- tools/autograd
- torch
- nn
- testing/_internal
3 files changed
+8
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1205 | 1205 | | |
1206 | 1206 | | |
1207 | 1207 | | |
| 1208 | + | |
1208 | 1209 | | |
1209 | 1210 | | |
1210 | 1211 | | |
| |||
1523 | 1524 | | |
1524 | 1525 | | |
1525 | 1526 | | |
| 1527 | + | |
1526 | 1528 | | |
1527 | 1529 | | |
1528 | 1530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2629 | 2629 | | |
2630 | 2630 | | |
2631 | 2631 | | |
2632 | | - | |
2633 | | - | |
2634 | | - | |
2635 | | - | |
2636 | | - | |
2637 | | - | |
2638 | | - | |
2639 | | - | |
2640 | | - | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
2641 | 2636 | | |
2642 | 2637 | | |
2643 | 2638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3879 | 3879 | | |
3880 | 3880 | | |
3881 | 3881 | | |
3882 | | - | |
| 3882 | + | |
3883 | 3883 | | |
3884 | 3884 | | |
3885 | 3885 | | |
| |||
4277 | 4277 | | |
4278 | 4278 | | |
4279 | 4279 | | |
4280 | | - | |
| 4280 | + | |
4281 | 4281 | | |
4282 | 4282 | | |
4283 | 4283 | | |
| |||
0 commit comments