Skip to content

Commit cdf6050

Browse files
committed
fix optimizer runner too
1 parent 67117a8 commit cdf6050

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchsim/runners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ def convergence_fn(state: BaseState, last_energy: torch.Tensor) -> bool:
136136
)
137137
state: BaseState = initialize_state(system, model.device, model.dtype)
138138

139-
state, update_fn = optimizer(
140-
state=state,
139+
init_fn, update_fn = optimizer(
141140
model=model,
142141
**optimizer_kwargs,
143142
)
143+
state = init_fn(state)
144144

145145
step: int = 1
146146
last_energy = state.energy + 1

0 commit comments

Comments
 (0)