code: def forward(
      self,
      model,
      noise_map,
      text_encoding,
      text_mask,
      x_low_res=None,
      cond_scale=1.0,
      sampling_steps=None,
      thresholding_method="dynamic",
  ):
      batch = noise_map.shape[0]
      device = noise_map.device
      dtype = noise_map.dtype
      original_steps = self.noise_scheduler.num_timesteps
      if sampling_steps:
          self.noise_scheduler.num_timesteps = sampling_steps
      timesteps = self.noise_scheduler.get_sampling_timesteps(
          batch, device=device
      )
      img = noise_map
      for times, times_next in tqdm(timesteps, total=len(timesteps)):
          img, x_start = self.p_sample(
              unet=model,
              x=img.type(dtype),
              t=times.type(dtype),
              t_next=times_next.type(dtype),
              text_embeds=text_encoding,
              text_mask=text_mask,
              cond_scale=cond_scale,
              x_low_res=x_low_res.type(dtype)
              if x_low_res is not None
              else None,
              thresholding_method=thresholding_method,
          )
      self.noise_scheduler.num_timesteps = original_steps
      return img
  
imports: import numpy
  import torch
  from einops import rearrange
  from tqdm import tqdm
  from nemo.collections.multimodal.modules.imagen.sampler.batch_ops import batch_div, batch_mul
  from nemo.collections.multimodal.modules.imagen.sampler.continuous_ddpm import GaussianDiffusionContinuousTimes
label_desc: Use image node_id 4 for calling the DDPMSampler obj's underlying member method code with example usage: obj.forward(model, noise_map, text_encoding, text_mask, x_low_res, cond_scale, sampling_steps, thresholding_method) and returns: img