class_docstr: Utilities for training and sampling diffusion models.
  Original ported from this codebase:
  https://github.com/hojonathanho/diffusion/blob/1e0dceb3b3495bbe19116a5e1b3596cd0706c543/diffusion_tf/diffusion_utils_2.py#L42
  :param betas: a 1-D numpy array of betas for each diffusion timestep,
                starting at T and going to 1.
class_docstr_tok: ["Utilities","for","training","and","sampling","diffusion","models",".","Original","ported","from","this","codebase",":","https",":","\/\/github.com\/hojonathanho\/diffusion\/blob\/1e0dceb3b3495bbe19116a5e1b3596cd0706c543\/diffusion_tf\/diffusion_utils_2.py","#","L42",":","param","betas",":","a","1-D","numpy","array","of","betas","for","each","diffusion","timestep",",","starting","at","T","and","going","to","1","."]
docstr: Sample x_{t+1} from the model using DDIM reverse ODE.
docstr_tok: ["Sample","x_","{","t+1","}","from","the","model","using","DDIM","reverse","ODE","."]
code: def ddim_reverse_sample(
      self,
      model,
      x,
      t,
      clip_denoised=True,
      denoised_fn=None,
      cond_fn=None,
      model_kwargs=None,
      eta=0.0,
  ):
      """
      Sample x_{t+1} from the model using DDIM reverse ODE.
      """
      assert eta == 0.0, "Reverse ODE only for deterministic path"
      out = self.p_mean_variance(
          model,
          x,
          t,
          clip_denoised=clip_denoised,
          denoised_fn=denoised_fn,
          model_kwargs=model_kwargs,
      )
      if cond_fn is not None:
          out = self.condition_score(
              cond_fn, out, x, t, model_kwargs=model_kwargs
          )
      # Usually our model outputs epsilon, but we re-derive it
      # in case we used x_start or x_prev prediction.
      eps = (
          _extract_into_tensor(
              self.sqrt_recip_alphas_cumprod, t, x.shape
          )
          * x
          - out["pred_xstart"]
      ) / _extract_into_tensor(
          self.sqrt_recipm1_alphas_cumprod, t, x.shape
      )
      alpha_bar_next = _extract_into_tensor(
          self.alphas_cumprod_next, t, x.shape
      )
  
      # Equation 12. reversed
      mean_pred = (
          out["pred_xstart"] * th.sqrt(alpha_bar_next)
          + th.sqrt(1 - alpha_bar_next) * eps
      )
  
      return {"sample": mean_pred, "pred_xstart": out["pred_xstart"]}
  
imports: import enum
  import math
  import numpy
  import torch
label_desc: Use image node_id 15 for calling the GaussianDiffusion obj's underlying member method code with example usage: obj.ddim_reverse_sample(model, x, t, clip_denoised, denoised_fn, cond_fn, model_kwargs, eta) and returns: dict