parameters: (self, tag, img_tensor, global_step=None, walltime=None, dataformats='CHW')
docstring: 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
              walltime (float): Optional override default walltime (time.time())
                seconds after epoch of event
          Shape:
              img_tensor: Default is :math:`(3, H, W)`. You can use ``torchvision.utils.make_grid()`` to
              convert a batch of tensor into 3xHxW format or call ``add_images`` and let us do the job.
              Tensor with :math:`(1, H, W)`, :math:`(H, W)`, :math:`(H, W, 3)` is also suitable as long as
              corresponding ``dataformats`` argument is passed, e.g. ``CHW``, ``HWC``, ``HW``.
  
          Examples::
  
              from torch.utils.tensorboard import SummaryWriter
              import numpy as np
              img = np.zeros((3, 100, 100))
              img[0] = np.arange(0, 10000).reshape(100, 100) / 10000
              img[1] = 1 - np.arange(0, 10000).reshape(100, 100) / 10000
  
              img_HWC = np.zeros((100, 100, 3))
              img_HWC[:, :, 0] = np.arange(0, 10000).reshape(100, 100) / 10000
              img_HWC[:, :, 1] = 1 - np.arange(0, 10000).reshape(100, 100) / 10000
  
              writer = SummaryWriter()
              writer.add_image('my_image', img, 0)
  
              # If you have non-default dimension setting, set the dataformats argument.
              writer.add_image('my_image_HWC', img_HWC, 0, dataformats='HWC')
              writer.close()
  
          Expected result:
  
          .. image:: _static/img/tensorboard/add_image.png
             :scale: 50 %
docstring_summary: Add image data to summary.
docstring_tokens: Add image data to summary .
function: def add_image(self, tag, img_tensor, global_step=None, walltime=None, dataformats='CHW'):
          """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
              walltime (float): Optional override default walltime (time.time())
                seconds after epoch of event
          Shape:
              img_tensor: Default is :math:`(3, H, W)`. You can use ``torchvision.utils.make_grid()`` to
              convert a batch of tensor into 3xHxW format or call ``add_images`` and let us do the job.
              Tensor with :math:`(1, H, W)`, :math:`(H, W)`, :math:`(H, W, 3)` is also suitable as long as
              corresponding ``dataformats`` argument is passed, e.g. ``CHW``, ``HWC``, ``HW``.
  
          Examples::
  
              from torch.utils.tensorboard import SummaryWriter
              import numpy as np
              img = np.zeros((3, 100, 100))
              img[0] = np.arange(0, 10000).reshape(100, 100) / 10000
              img[1] = 1 - np.arange(0, 10000).reshape(100, 100) / 10000
  
              img_HWC = np.zeros((100, 100, 3))
              img_HWC[:, :, 0] = np.arange(0, 10000).reshape(100, 100) / 10000
              img_HWC[:, :, 1] = 1 - np.arange(0, 10000).reshape(100, 100) / 10000
  
              writer = SummaryWriter()
              writer.add_image('my_image', img, 0)
  
              # If you have non-default dimension setting, set the dataformats argument.
              writer.add_image('my_image_HWC', img_HWC, 0, dataformats='HWC')
              writer.close()
  
          Expected result:
  
          .. image:: _static/img/tensorboard/add_image.png
             :scale: 50 %
  
          """
          torch._C._log_api_usage_once("tensorboard.logging.add_image")
          if self._check_caffe2_blob(img_tensor):
              from caffe2.python import workspace
              img_tensor = workspace.FetchBlob(img_tensor)
          self._get_file_writer().add_summary(
              image(tag, img_tensor, dataformats=dataformats), global_step, walltime)
function_tokens: def add_image ( self , tag , img_tensor , global_step = None , walltime = None , dataformats = 'CHW' ) : torch . _C . _log_api_usage_once ( "tensorboard.logging.add_image" ) if self . _check_caffe2_blob ( img_tensor ) : from caffe2 . python import workspace img_tensor = workspace . FetchBlob ( img_tensor ) self . _get_file_writer ( ) . add_summary ( image ( tag , img_tensor , dataformats = dataformats ) , global_step , walltime )