Skip to content

Commit f1eec41

Browse files
yhl48Borda
authored andcommitted
Update Custom Callback Docs (#17161)
Co-authored-by: Jirka Borovec <[email protected]>
1 parent de06af0 commit f1eec41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source-pytorch/extensions/callbacks_state.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ the following example.
2222
self.state = {"epochs": 0, "batches": 0}
2323

2424
@property
25-
def state_key(self):
25+
def state_key(self) -> str:
2626
# note: we do not include `verbose` here on purpose
27-
return self._generate_state_key(what=self.what)
27+
return f"Counter[what={self.what}]"
2828

2929
def on_train_epoch_end(self, *args, **kwargs):
3030
if self.what == "epochs":

0 commit comments

Comments
 (0)