Update Custom Callback Docs (#17161)

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
This commit is contained in:
Yi Heng Lim 2023-03-24 12:42:15 +00:00 committed by GitHub
parent e7ef8db57e
commit 27c1faaf8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -22,9 +22,9 @@ the following example.
self.state = {"epochs": 0, "batches": 0} self.state = {"epochs": 0, "batches": 0}
@property @property
def state_key(self): def state_key(self) -> str:
# note: we do not include `verbose` here on purpose # note: we do not include `verbose` here on purpose
return self._generate_state_key(what=self.what) return f"Counter[what={self.what}]"
def on_train_epoch_end(self, *args, **kwargs): def on_train_epoch_end(self, *args, **kwargs):
if self.what == "epochs": if self.what == "epochs":