class_docstr: A base diffusion implementation
  
  Arguments
  ---------
  model: nn.Module
      the underlying model
  timesteps: int
      the number of timesteps
  noise: callable|str
      the noise function/module to use
  
      The following predefined types of noise are provided
      "gaussian": Gaussian noise, applied to the whole sample
      "length_masked_gaussian": Gaussian noise applied only
          to the parts of the sample that is not padding
docstr: Generates the number of samples indicated by the
  count parameter
  
  Arguments
  ---------
  shape: enumerable
      the shape of the sample to generate
  
  
  Returns
  -------
  result: torch.Tensor
      the generated sample(s)
code: def sample(self, shape, **kwargs):
      """Generates the number of samples indicated by the
      count parameter
  
      Arguments
      ---------
      shape: enumerable
          the shape of the sample to generate
  
  
      Returns
      -------
      result: torch.Tensor
          the generated sample(s)
      """
      raise NotImplementedError
  
imports: from collections import namedtuple
  import torch
  from torch import nn
  from torch.nn import functional
  from tqdm.auto import tqdm
  from speechbrain.utils.data_utils import unsqueeze_as
  from speechbrain.dataio.dataio import length_to_mask
  from speechbrain.utils import data_utils
label_desc: Use image node_id 4 for calling the Diffuser obj's underlying member method code with example usage: obj.sample(shape) without return types