Skip to content

Commit abea29b

Browse files
ar90ncarmocca
andauthored
Move type annotation into __init__ (#14943)
Co-authored-by: Carlos Mocholí <[email protected]>
1 parent a9142d6 commit abea29b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/pytorch_lightning/callbacks/batch_size_finder.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
class BatchSizeFinder(Callback):
3232
SUPPORTED_MODES = ("power", "binsearch")
3333

34-
optimal_batch_size: Optional[int]
35-
3634
def __init__(
3735
self,
3836
mode: str = "power",
@@ -73,7 +71,7 @@ def __init__(
7371
mode = mode.lower()
7472
if mode not in self.SUPPORTED_MODES:
7573
raise ValueError(f"`mode` should be either of {self.SUPPORTED_MODES}")
76-
self.optimal_batch_size = init_val
74+
self.optimal_batch_size: Optional[int] = init_val
7775
self._mode = mode
7876
self._steps_per_trial = steps_per_trial
7977
self._init_val = init_val

0 commit comments

Comments
 (0)