class_docstr: ## Sampler class
class_docstr_tok: ["#","#","Sampler","class"]
docstr: Helper function to display an image
docstr_tok: ["Helper","function","to","display","an","image"]
code: def show_image(self, img, title=""):
      """Helper function to display an image"""
      img = img.clip(0, 1)
      img = img.cpu().numpy()
      plt.imshow(img.transpose(1, 2, 0))
      plt.title(title)
      plt.show()
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/diffusion/ddpm/evaluate.py
imports: import numpy
  import torch
  from matplotlib import pyplot
  from torchvision.transforms.functional import to_pil_image, resize
  from labml import experiment, monit
  from labml_nn.diffusion.ddpm import DenoiseDiffusion, gather
  from labml_nn.diffusion.ddpm.experiment import Configs
label_desc: Use image node_id 2 for calling the Sampler obj's underlying member method code with example usage: obj.show_image(img, title) without return types