summaryrefslogtreecommitdiff
path: root/text_recognizer/models/base.py
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2021-11-21 21:35:50 +0100
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2021-11-21 21:35:50 +0100
commitfe43389ad26559cc09f2fd00441c02556ff674c3 (patch)
tree0ce6a70c0dc2ea54bac7e19b539af5aec4ebab19 /text_recognizer/models/base.py
parenta9363f3944f1ad31590c48d5d51c45df3bbf43b1 (diff)
Format files
Diffstat (limited to 'text_recognizer/models/base.py')
-rw-r--r--text_recognizer/models/base.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/text_recognizer/models/base.py b/text_recognizer/models/base.py
index cc54de4..821cb69 100644
--- a/text_recognizer/models/base.py
+++ b/text_recognizer/models/base.py
@@ -46,6 +46,7 @@ class BaseLitModel(LightningModule):
optimizer: Type[torch.optim.Optimizer],
optimizer_idx: int,
) -> None:
+ """Optimal way to set grads to zero."""
optimizer.zero_grad(set_to_none=True)
def _configure_optimizer(self) -> List[Type[torch.optim.Optimizer]]: