f-dangel / backpack

BackPACK - a backpropagation package built on top of PyTorch which efficiently computes quantities other than the gradient.
https://backpack.pt/
MIT License
562 stars 56 forks source link

[FIX] Use `materialize_grads` in L_op #338

Closed f-dangel closed 2 weeks ago

f-dangel commented 2 weeks ago

Before this PR, the GGNvp will crash whenever the compute graph does not depend on one parameter. This PR fixes this behaviour and leads to treating the GGN parts w.r.t. this parameter as zero.