From fe43389ad26559cc09f2fd00441c02556ff674c3 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sun, 21 Nov 2021 21:35:50 +0100 Subject: Format files --- text_recognizer/models/base.py | 1 + 1 file changed, 1 insertion(+) (limited to 'text_recognizer/models/base.py') 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]]: -- cgit v1.2.3-70-g09d2