Skip to content

Commit

Permalink
another no grad
Browse files Browse the repository at this point in the history
  • Loading branch information
Marton Havasi committed Dec 17, 2024
1 parent 6bc1f46 commit be2a367
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions flow_matching/solver/ode_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,15 @@ def dynamics_func(t, states):
y_init = (x_1, torch.zeros(x_1.shape[0], device=x_1.device))
ode_opts = {"step_size": step_size} if step_size is not None else {}

with torch.no_grad():
sol, log_det = odeint(
dynamics_func,
y_init,
time_grid,
method=method,
options=ode_opts,
atol=atol,
rtol=rtol,
)
sol, log_det = odeint(
dynamics_func,
y_init,
time_grid,
method=method,
options=ode_opts,
atol=atol,
rtol=rtol,
)

x_source = sol[-1]
source_log_p = log_p0(x_source)
Expand Down

0 comments on commit be2a367

Please sign in to comment.