Skip to content

Commit d0b23f7

Browse files
8greg8Gregor KoporecBordaSeanNaren
committed
[bugfix] Correct call to torch.no_grad (#5124)
Co-authored-by: Gregor Koporec <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> Co-authored-by: Sean Naren <[email protected]>
1 parent d72ba90 commit d0b23f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_lightning/utilities/distributed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,6 @@ def all_gather_ddp_if_available(
206206
if sync_grads:
207207
return AllGatherGrad.apply(tensor, group)
208208
else:
209-
with torch.no_grad:
209+
with torch.no_grad():
210210
return AllGatherGrad.apply(tensor, group)
211211
return tensor

0 commit comments

Comments
 (0)