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

[REF] Ignore warning to explicitly declare `abstractmethod`s #264

Closed f-dangel closed 1 year ago

f-dangel commented 1 year ago

Fixes linting complaints from the latest flake8 about missing declarations of abstract methods in abstract classes.

Edit: Instead of declaring the abstract methods, we will ignore this warning. This is because some methods that are "marked" as abstract by raising a NotImplementedError are never implemented for certain modules (e.g. the residual-mat-prod for Linear layers, as it is never used). Explicitly marking them with @abstractmethod leads to failure of the code when instantiating an instance whose abstract method is not implemented.