code: def imshow(inp, image_path=None):
      # plot images
      inp = inp.cpu().numpy().transpose((1, 2, 0))
      space = np.ones((inp.shape[0], 50, inp.shape[2]))
      inp = np.concatenate([space, inp], axis=1)
  
      ax = plt.axes(frameon=False, xticks=[], yticks=[])
      ax.text(0, 23, "Inputs:")
      ax.text(0, 23 + 28 + 3, "Truth:")
      ax.text(0, 23 + (28 + 3) * 2, "NN:")
      ax.text(0, 23 + (28 + 3) * 3, "CVAE:")
      ax.imshow(inp)
  
      if image_path is not None:
          Path(image_path).parent.mkdir(parents=True, exist_ok=True)
          plt.savefig(image_path, bbox_inches="tight", pad_inches=0.1)
      else:
          plt.show()
  
      plt.clf()
  
file_path: pyro/examples/cvae/util.py
imports: from pathlib import Path
  import matplotlib.pyplot
  import numpy
  import pandas
  import torch
  from baseline import MaskedBCELoss
  from mnist import get_data
  from torch.utils.data import DataLoader
  from torchvision.utils import make_grid
  from tqdm import tqdm
  from pyro.infer import Predictive, Trace_ELBO
label_desc: Use image node_id 1 for calling a global function with example usage: imshow(inp, image_path) without return types