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

Tag surgery algorithms LPLN and LPGN #2011

Merged
merged 1 commit into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ def __init__(self, apply_at: Event = Event.INIT):
if self.apply_at not in {Event.INIT, Event.AFTER_LOAD}:
raise ValueError('LowPrecisionGroupNorm only supports application on Event.INIT and Event.AFTER_LOAD.')

def __repr__(self) -> str:
return f'{self.__class__.__name__}(apply_at={self.apply_at})'

@staticmethod
def required_on_load() -> bool:
return True

def match(self, event: Event, state: State) -> bool:
del state # unused
return event == self.apply_at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ def __init__(self, apply_at: Event = Event.INIT):
if self.apply_at not in {Event.INIT, Event.AFTER_LOAD}:
raise ValueError('LowPrecisionLayerNorm only supports application on Event.INIT and Event.AFTER_LOAD.')

def __repr__(self) -> str:
return f'{self.__class__.__name__}(apply_at={self.apply_at})'

@staticmethod
def required_on_load() -> bool:
return True

def match(self, event: Event, state: State) -> bool:
del state # unused
return event == self.apply_at
Expand Down