tfjgeorge / nngeometry

{KFAC,EKFAC,Diagonal,Implicit} Fisher Matrices and finite width NTKs in PyTorch
https://nngeometry.readthedocs.io
MIT License
206 stars 20 forks source link

fixes autograd error when using inplace operations #42

Closed tfjgeorge closed 2 years ago

tfjgeorge commented 2 years ago

This should fix issue #40 when using inplace operations.

It uses tensor backward hooks as suggested in https://github.com/pytorch/pytorch/issues/61519

codecov-commenter commented 2 years ago

Codecov Report

Merging #42 (0ecb989) into master (4510c47) will decrease coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
- Coverage   93.22%   93.20%   -0.02%     
==========================================
  Files          29       29              
  Lines        3277     3268       -9     
==========================================
- Hits         3055     3046       -9     
  Misses        222      222              
Impacted Files Coverage Δ
nngeometry/generator/jacobian/grads.py 100.00% <ø> (ø)
tests/test_jacobian.py 99.69% <ø> (-0.01%) :arrow_down:
nngeometry/generator/jacobian/__init__.py 98.38% <100.00%> (-0.02%) :arrow_down:
tests/tasks.py 84.24% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4510c47...0ecb989. Read the comment docs.