Skip to content

Commit ec7296c

Browse files
committed
fix: comment
1 parent 211608b commit ec7296c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

deepmd/pt_expt/train/training.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ def _expand(t: torch.Tensor | None) -> torch.Tensor | None:
324324
del fparam
325325
if aparam is not None:
326326
del aparam
327+
if charge_spin is not None:
328+
del charge_spin
327329

328330
# make_fx inserts aten.detach.default for saved tensors used in the
329331
# decomposed autograd.grad backward ops. These detach nodes break
@@ -1048,7 +1050,7 @@ def _compile_model(self, compile_opts: dict[str, Any]) -> None:
10481050
ext_coord, ext_atype, nlist_t, mapping, fparam, aparam, charge_spin
10491051
)
10501052
del _warmup_out
1051-
if DEVICE.type == "cuda" and torch.cuda.is_initialized():
1053+
if DEVICE.type == "cuda":
10521054
torch.cuda.synchronize()
10531055

10541056
wrapper_mod.model[task_key] = _CompiledModel(model, compiled_lower)

0 commit comments

Comments
 (0)