code: def p_sample_loop(self, shape, cond):
      device = self.betas.device
  
      b = shape[0]
      img = torch.randn(shape, device=device)
  
      for i in reversed(range(0, self.num_timesteps)):
          img = self.p_sample(
              img,
              cond,
              torch.full((b,), i, device=device, dtype=torch.long),
          )
      return img
  
imports: from functools import partial
  from inspect import isfunction
  import numpy
  import torch
  from torch import nn, einsum
  import torch.nn.functional
label_desc: Use image node_id 9 for calling the GaussianDiffusion obj's underlying member method code with example usage: obj.p_sample_loop(shape, cond) and returns: img