File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -242,11 +242,11 @@ def _create_stream_context(self, device_ids=None):
242
242
and device_ids is not None
243
243
):
244
244
stream = self .torch_lib .Stream ()
245
- return self .torch_lib .stream (stream )
245
+ ctx = self .torch_lib .stream (stream )
246
246
else :
247
247
from contextlib import nullcontext
248
-
249
- return nullcontext ()
248
+ ctx = nullcontext ()
249
+ return ctx
250
250
251
251
252
252
class _DDPBackwardSyncControl (_BackwardSyncControl ):
Original file line number Diff line number Diff line change @@ -431,11 +431,11 @@ def _create_stream_context(self, device_ids=None):
431
431
and device_ids is not None
432
432
):
433
433
stream = self .torch_lib .Stream ()
434
- return self .torch_lib .stream (stream )
434
+ ctx = self .torch_lib .stream (stream )
435
435
else :
436
436
from contextlib import nullcontext
437
-
438
- return nullcontext ()
437
+ ctx = nullcontext ()
438
+ return ctx
439
439
440
440
441
441
class _DDPForwardRedirection (_ForwardRedirection ):
You can’t perform that action at this time.
0 commit comments