Skip to content

Commit a1950b0

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 43441a4 commit a1950b0

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎colossalai/legacy/utils/activation_checkpoint.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,10 @@ def inner_unpack(packed):
226226

227227
# rerun forward, the inner_pack will store all the activations in storage
228228
if has_autocast_in_fwd:
229-
with torch.enable_grad(), get_accelerator().autocast()(), torch.autograd.graph.saved_tensors_hooks(
230-
inner_pack, inner_unpack
229+
with (
230+
torch.enable_grad(),
231+
get_accelerator().autocast()(),
232+
torch.autograd.graph.saved_tensors_hooks(inner_pack, inner_unpack),
231233
):
232234
_unused = function(*args)
233235
else:

0 commit comments

Comments
 (0)