class_docstr: DPM-Solver. See https://arxiv.org/abs/2206.00927.
class_docstr_tok: ["DPM-Solver",".","See","https",":","\/\/arxiv.org\/abs\/2206.00927","."]
code: def dpm_solver_2_step(self, x, t, t_next, r1=1 / 2, eps_cache=None):
      eps_cache = {} if eps_cache is None else eps_cache
      h = t_next - t
      eps, eps_cache = self.eps(eps_cache, "eps", x, t)
      s1 = t + r1 * h
      u1 = x - self.sigma(s1) * (r1 * h).expm1() * eps
      eps_r1, eps_cache = self.eps(eps_cache, "eps_r1", u1, s1)
      x_2 = (
          x
          - self.sigma(t_next) * h.expm1() * eps
          - self.sigma(t_next) / (2 * r1) * h.expm1() * (eps_r1 - eps)
      )
      return x_2, eps_cache
  
imports: import math
  import torch
  import torchsde
  from scipy import integrate
  from torch import nn
  from torchdiffeq import odeint
  from tqdm.auto import tqdm, trange
label_desc: Use image node_id 6 for calling the DPMSolver obj's underlying member method code with example usage: obj.dpm_solver_2_step(x, t, t_next, r1, eps_cache) and returns: x_2,  eps_cache