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: Use DDIM to sample from the model and yield intermediate samples from
  each timestep of DDIM.
  Same usage as p_sample_loop_progressive().
docstr_tok: ["Use","DDIM","to","sample","from","the","model","and","yield","intermediate","samples","from","each","timestep","of","DDIM",".","Same","usage","as","p_sample_loop_progressive","(",")","."]
code: def ddim_sample_loop_progressive(
      self,
      model,
      shape,
      noise=None,
      clip_denoised=True,
      denoised_fn=None,
      cond_fn=None,
      model_kwargs=None,
      device=None,
      progress=False,
      eta=0.0,
  ):
      """
      Use DDIM to sample from the model and yield intermediate samples from
      each timestep of DDIM.
      Same usage as p_sample_loop_progressive().
      """
      if device is None:
          device = next(model.parameters()).device
      assert isinstance(shape, (tuple, list))
      if noise is not None:
          img = noise
      else:
          img = th.randn(*shape, device=device)
      indices = list(range(self.num_timesteps))[::-1]
  
      if progress:
          # Lazy import so that we don't depend on tqdm.
          from tqdm.auto import tqdm
  
          indices = tqdm(indices)
  
      for i in indices:
          t = th.tensor([i] * shape[0], device=device)
          with th.no_grad():
              out = self.ddim_sample(
                  model,
                  img,
                  t,
                  clip_denoised=clip_denoised,
                  denoised_fn=denoised_fn,
                  cond_fn=cond_fn,
                  model_kwargs=model_kwargs,
                  eta=eta,
              )
              yield out
              img = out["sample"]
  
imports: import enum
  import math
  import numpy
  import torch
label_desc: Use image node_id 17 for calling the GaussianDiffusion obj's underlying member method code with example usage: obj.ddim_sample_loop_progressive(model, shape, noise, clip_denoised, denoised_fn, cond_fn, model_kwargs, device, progress, eta) without return types