docstr: Add image data to summary.
  
  Note that this requires the ``pillow`` package.
  
  Args:
      tag (string): Data identifier
      img_tensor (torch.Tensor, numpy.array, or string/blobname): Image data
      global_step (int): Global step value to record
  Shape:
      img_tensor: :math:`(C, H, W)`. Use ``torchvision.utils.make_grid()`` to prepare it is a good idea.
      C = colors (can be 1 - grayscale, 3 - RGB, 4 - RGBA)
docstr_tok: ["Add","image","data","to","summary",".","Note","that","this","requires","the","``","pillow","``","package",".","Args",":","tag","(","string",")",":","Data","identifier","img_tensor","(","torch.Tensor",",","numpy.array",",","or","string\/blobname",")",":","Image","data","global_step","(","int",")",":","Global","step","value","to","record","Shape",":","img_tensor",":",":","math",":","`","(","C",",","H",",","W",")","`",".","Use","``","torchvision.utils.make_grid","(",")","``","to","prepare","it","is","a","good","idea",".","C","=","colors","(","can","be","1","-","grayscale",",","3","-","RGB",",","4","-","RGBA",")"]
code: def add_image(self, tag, img_tensor, global_step=None, caption=None):
      """Add image data to summary.
  
      Note that this requires the ``pillow`` package.
  
      Args:
          tag (string): Data identifier
          img_tensor (torch.Tensor, numpy.array, or string/blobname): Image data
          global_step (int): Global step value to record
      Shape:
          img_tensor: :math:`(C, H, W)`. Use ``torchvision.utils.make_grid()`` to prepare it is a good idea.
          C = colors (can be 1 - grayscale, 3 - RGB, 4 - RGBA)
      """
      img_tensor = make_np(img_tensor)
      self.vis.image(
          img_tensor, opts={"title": tag, "caption": caption}
      )
  
imports: import gc
  import numpy
  import math
  import json
  import time
  from .summary import compute_curve
  from .utils import figure_to_image
  from .x2num import make_np
label_desc: Use image node_id 7 for calling the VisdomWriter obj's underlying member method code with example usage: obj.add_image(tag, img_tensor, global_step, caption) without return types