docstr: Fit an interpolating polynomial to the results of a Runge-Kutta step.
docstr_tok: ["Fit","an","interpolating","polynomial","to","the","results","of","a","Runge-Kutta","step","."]
code: def _interp_fit(self, y0, y1, k, dt):
      """Fit an interpolating polynomial to the results of a Runge-Kutta step."""
      dt = dt.type_as(y0)
      y_mid = y0 + torch.sum(k * (dt * self.mid), dim=-1).view_as(y0)
      f0 = k[..., 0]
      f1 = k[..., -1]
      return _interp_fit(y0, y1, y_mid, f0, f1, dt)
  
imports: import bisect
  import collections
  import torch
  from .event_handling import find_event
  from .interp import _interp_evaluate, _interp_fit
  from .misc import _compute_error_ratio, _select_initial_step, _optimal_step_size
  from .misc import Perturb
  from .solvers import AdaptiveStepsizeEventODESolver
label_desc: Use image node_id 7 for calling the RKAdaptiveStepsizeODESolver obj's underlying member method code with example usage: obj._interp_fit(y0, y1, k, dt) and returns: _interp_fit