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
555 stars 55 forks source link

[CI] Test with `torch=={1.9.0, 1.12.0}` and make tests compatible (master) #276

Closed f-dangel closed 1 year ago

f-dangel commented 1 year ago

The test suite broke between torch==1.11 and torch==1.12 due to JVPs with torch.autograd. Until 1.11 their outcome used to be contiguous, which changed in 1.12. Hence we cannot rely on the PyTorch built-in utility parameters_to_vector, which uses a view under the hood.

This PR makes the test suite compatible with torch==1.12 (also run by the test CI).