code: def add_image(self, tag, image, global_step=None):
          
          self._file_writer.add_summary(image_summary(tag, image), global_step)
docs: Add image data to the event file.
          This function supports input as a 2D, 3D, or 4D image.
          If the input image is 2D, a channel axis is prepended as the first dimension
          and image will be replicated three times and concatenated along the channel axis.
          If the input image is 3D, it will be replicated three times and concatenated along
          the channel axis. If the input image is 4D, which is a batch images, all the
          images will be spliced as a sprite image for display.
  
          Note: This function requires the ``pillow`` package.
  
          Note: This function internally calls `asnumpy()` for MXNet `NDArray` inputs.
          Since `asnumpy()` is a blocking function call, this function would block the main
          thread till it returns. It may consequently affect the performance of async execution
          of the MXNet engine.
  
          Parameters
          ----------
              tag : str
                  Name for the `image`.
              image : MXNet `NDArray` or `numpy.ndarray`
                  Image is one of the following formats: (H, W), (C, H, W), (N, C, H, W).
                  If the input is a batch of images, a grid of images is made by stitching them
                  together.
                  If data type is float, values must be in range [0, 1], and then they are
                  rescaled to range [0, 255]. Note that this does not change the values of the
                  input `image`. A copy of the input `image` is created instead.
                  If data type is 'uint8`, values are unchanged.
              global_step : int
                  Global step value to record.