File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments