Skip to content

Commit e5a60ff

Browse files
committed
test_multiple_trainer_constant_memory_allocated
1 parent 8e3b5bf commit e5a60ff

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tests/tests_pytorch/trainer/test_trainer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,8 +1750,6 @@ def current_memory():
17501750
gc.collect()
17511751
return torch.cuda.memory_allocated(0)
17521752

1753-
initial = current_memory()
1754-
17551753
model = TestModel()
17561754
trainer_kwargs = {
17571755
"default_root_dir": tmp_path,
@@ -1763,6 +1761,7 @@ def current_memory():
17631761
"callbacks": Check(),
17641762
}
17651763
trainer = Trainer(**trainer_kwargs)
1764+
initial = current_memory()
17661765
trainer.fit(model)
17671766

17681767
assert trainer.strategy.model is model

0 commit comments

Comments
 (0)