Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#189 Add unpatch for dropout and consistent dropout #194

Merged
merged 5 commits into from
Mar 21, 2022
Merged

Conversation

Dref360
Copy link
Member

@Dref360 Dref360 commented Mar 3, 2022

Summary:

Add ability to unpatch modules to Dropout and Consistent dropout.
Not yet available for dropconnect as it is a bit more complicated.

Features:

WIP on #189

Checklist:

  • Your code is documented (To validate this, add your module to tests/documentation_test.py).
  • Your code is tested with unit tests.
  • You moved your Issue to the PR state.

@Dref360 Dref360 requested a review from parmidaatg March 3, 2022 22:07
Copy link
Collaborator

@parmidaatg parmidaatg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏼


def forward(self, *args, **kwargs):
return self.parent_module.forward(*args, **kwargs)

def unpatch(self) -> torch.nn.Module:
return unpatch_module(self.parent_module)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will make sure that self.parent_module is always patched but at every step the user can ask for an unpatched version right? its very useful just wanna make sure that if you call unpatch the internal module remains patched.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants