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.
docstr: Compute the mean for the previous step, given a function cond_fn that
  computes the gradient of a conditional log probability with respect to
  x. In particular, cond_fn computes grad(log(p(y|x))), and we want to
  condition on y.
  
  This uses the conditioning strategy from Sohl-Dickstein et al. (2015).
docstr_tok: ["Compute","the","mean","for","the","previous","step",",","given","a","function","cond_fn","that","computes","the","gradient","of","a","conditional","log","probability","with","respect","to","x",".","In","particular",",","cond_fn","computes","grad","(","log","(","p","(","y|x",")",")",")",",","and","we","want","to","condition","on","y",".","This","uses","the","conditioning","strategy","from","Sohl-Dickstein","et","al",".","(","2015",")","."]
code: def condition_mean(
      self, cond_fn, p_mean_var, x, t, model_kwargs=None
  ):
      """
      Compute the mean for the previous step, given a function cond_fn that
      computes the gradient of a conditional log probability with respect to
      x. In particular, cond_fn computes grad(log(p(y|x))), and we want to
      condition on y.
  
      This uses the conditioning strategy from Sohl-Dickstein et al. (2015).
      """
      gradient = cond_fn(x, t, **model_kwargs)
      new_mean = (
          p_mean_var["mean"].float()
          + p_mean_var["variance"] * gradient.float()
      )
      return new_mean
  
imports: import math
  import numpy
  import torch
label_desc: Use image node_id 8 for calling the GaussianDiffusion obj's underlying member method code with example usage: obj.condition_mean(cond_fn, p_mean_var, x, t, model_kwargs) and returns: new_mean