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: Diffuse the data for a given number of diffusion steps.
  In other words, sample from q(x_t | x_0).
  :param x_start: the initial data batch.
  :param t: the number of diffusion steps (minus 1). Here, 0 means one step.
  :param noise: if specified, the split-out normal noise.
  :return: A noisy version of x_start.
docstr_tok: ["Diffuse","the","data","for","a","given","number","of","diffusion","steps",".","In","other","words",",","sample","from","q","(","x_t","|","x_0",")",".",":","param","x_start",":","the","initial","data","batch",".",":","param","t",":","the","number","of","diffusion","steps","(","minus","1",")",".","Here",",","0","means","one","step",".",":","param","noise",":","if","specified",",","the","split-out","normal","noise",".",":","return",":","A","noisy","version","of","x_start","."]
code: def q_sample(self, x_start, t, noise=None):
      """
      Diffuse the data for a given number of diffusion steps.
      In other words, sample from q(x_t | x_0).
      :param x_start: the initial data batch.
      :param t: the number of diffusion steps (minus 1). Here, 0 means one step.
      :param noise: if specified, the split-out normal noise.
      :return: A noisy version of x_start.
      """
      if noise is None:
          noise = th.randn_like(x_start)
      assert noise.shape == x_start.shape
      return (
          _extract_into_tensor(
              self.sqrt_alphas_cumprod, t, x_start.shape
          )
          * x_start
          + _extract_into_tensor(
              self.sqrt_one_minus_alphas_cumprod, t, x_start.shape
          )
          * noise
      )
  
imports: import enum
  import math
  import numpy
  import torch
label_desc: Use image node_id 3 for calling the GaussianDiffusion obj's underlying member method code with example usage: obj.q_sample(x_start, t, noise) and returns: unknown