code: def plot_conditional_samples_ssvae(ssvae, visdom_session):
      """
      This is a method to do conditional sampling in visdom
      """
      vis = visdom_session
      ys = {}
      for i in range(10):
          ys[i] = torch.zeros(1, 10)
          ys[i][0, i] = 1
      xs = torch.zeros(1, 784)
  
      for i in range(10):
          images = []
          for rr in range(100):
              # get the loc from the model
              sample_loc_i = ssvae.model(xs, ys[i])
              img = sample_loc_i[0].view(1, 28, 28).cpu().data.numpy()
              images.append(img)
          vis.images(images, 10, 2)
  
imports: import torch
label_desc: Use image node_id 1 for calling a global function with example usage: plot_conditional_samples_ssvae(ssvae, visdom_session) without return types