summaryrefslogtreecommitdiff
path: root/text_recognizer/models/base.py
diff options
context:
space:
mode:
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]]: