-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: Improved attribute access for modules_to_save (#2117)
Resolves #2099 So far, if a module was wrapped due to modules_to_save, we handled access to the weight and bias attribute (albeit incorrectly in case of disabled adapters!). However, there could be more attributes than those that could be accessed, in which case we got an error so far. Instead of special properties, we now implement a generic __getattr__ method that can deal with any attribute. The implementation is a bit complex to take into account the way that torch.nn.Module handles __getattr__.
- Loading branch information
1 parent
2a80735
commit ae297f0
Showing
2 changed files
with
119 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters