Skip to content

Commit

Permalink
remove syncing at each eval point
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilykuleshov committed Oct 2, 2024
1 parent d50855c commit 551942f
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions torchode/adjoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,16 @@ def solve(
)
>= 0.0
) & not_yet_evaluated
if to_be_evaluated.any():
interpolation = step_method.build_interpolation(interp_data)
nonzero = to_be_evaluated.nonzero()
sample_idx, eval_t_idx = nonzero[:, 0], nonzero[:, 1]
y_eval[sample_idx, eval_t_idx] = interpolation.evaluate(
t_eval[sample_idx, eval_t_idx], sample_idx
)
interpolation = step_method.build_interpolation(interp_data)
nonzero = to_be_evaluated.nonzero()
sample_idx, eval_t_idx = nonzero[:, 0], nonzero[:, 1]
y_eval[sample_idx, eval_t_idx] = interpolation.evaluate(
t_eval[sample_idx, eval_t_idx], sample_idx
)

not_yet_evaluated = torch.logical_xor(
to_be_evaluated, not_yet_evaluated
)
not_yet_evaluated = torch.logical_xor(
to_be_evaluated, not_yet_evaluated
)

########################
# Update the step size #
Expand Down

0 comments on commit 551942f

Please sign in to comment.