Skip to content

Commit e09941c

Browse files
authored
Update fabric.py
1 parent 56464ed commit e09941c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lightning/fabric/fabric.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ def setup(
225225
FSDP etc.). Set it to ``False`` if compiling DDP/FSDP is causing issues.
226226
227227
Returns:
228-
The tuple containing wrapped module and the optimizers, in the same order they were passed in.
228+
The tuple containing wrapped module, optimizers, and an optional learning rate scheduler,
229+
in the same order they were passed in.
229230
230231
"""
231232
self._validate_setup(module, optimizers)
@@ -269,7 +270,7 @@ def setup(
269270

270271
if optimizers:
271272
# join both types in a tuple for API convenience
272-
return (module, *optimizers, scheduler)
273+
return (module, *optimizers, scheduler) if scheduler is not None else (module, *optimizers)
273274
return module
274275

275276
def setup_module(

0 commit comments

Comments
 (0)