-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
module: scatter & gather opstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module
Description
🚀 Feature
Replace scatter_ in scatter's backward formula with scatter.
Motivation
functorch has a hard time with in-place operations and I don't see a good reason why scatter_ gets used here (please correct me if I'm wrong!). cc @albanD @soulitzer for sanity check - please let me know if I missed something here
pytorch/tools/autograd/derivatives.yaml
Lines 1187 to 1194 in 495e7e4
- name: scatter.src(Tensor self, int dim, Tensor index, Tensor src) -> Tensor | |
self: grad.clone().scatter_(dim, index, 0) | |
index: non_differentiable | |
src: grad.gather(dim, index) | |
- name: scatter.value(Tensor self, int dim, Tensor index, Scalar value) -> Tensor | |
self: grad.clone().scatter_(dim, index, 0) | |
index: non_differentiable |
Metadata
Metadata
Assignees
Labels
module: scatter & gather opstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate moduleThis issue has been looked at a team member, and triaged and prioritized into an appropriate module