docstr: Log a list of images.
  
  References:
      https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/04-utils/tensorboard/logger.py#L22
  
  Example:
      >>> tf_name = 'foo'
      >>> value = ([0, 1, 2, 3, 4, 5], [1, 20, 10, 22, 11])
      >>> self = Logger(None, is_dummy=True)
      >>> images = [np.random.rand(10, 10), np.random.rand(10, 10)]
      >>> summary = self._image_summary(tf_name, images, step=None)
      >>> assert len(summary.value) == 2
      >>> assert summary.value[0].image.width == 10
docstr_tok: ["Log","a","list","of","images",".","References",":","https",":","\/\/github.com\/yunjey\/pytorch-tutorial\/blob\/master\/tutorials\/04-utils\/tensorboard\/logger.py","#","L22","Example",":",">",">",">","tf_name","=","'foo'",">",">",">","value","=","(","[","0",",","1",",","2",",","3",",","4",",","5","]",",","[","1",",","20",",","10",",","22",",","11","]",")",">",">",">","self","=","Logger","(","None",",","is_dummy=True",")",">",">",">","images","=","[","np.random.rand","(","10",",","10",")",",","np.random.rand","(","10",",","10",")","]",">",">",">","summary","=","self._image_summary","(","tf_name",",","images",",","step=None",")",">",">",">","assert","len","(","summary.value",")","==","2",">",">",">","assert","summary.value","[","0","]",".image.width","==","10"]
code: def _image_summary(self, tf_name, images, step=None):
      """
      Log a list of images.
  
      References:
          https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/04-utils/tensorboard/logger.py#L22
  
      Example:
          >>> tf_name = 'foo'
          >>> value = ([0, 1, 2, 3, 4, 5], [1, 20, 10, 22, 11])
          >>> self = Logger(None, is_dummy=True)
          >>> images = [np.random.rand(10, 10), np.random.rand(10, 10)]
          >>> summary = self._image_summary(tf_name, images, step=None)
          >>> assert len(summary.value) == 2
          >>> assert summary.value[0].image.width == 10
      """
      img_summaries = []
      for i, img in enumerate(images):
          # Write the image to a string
          try:
              s = StringIO()
          except:
              s = BytesIO()
          scipy.misc.toimage(img).save(s, format="png")
  
          # Create an Image object
          img_sum = summary_pb2.Summary.Image(
              encoded_image_string=s.getvalue(),
              height=img.shape[0],
              width=img.shape[1],
          )
          # Create a Summary value
          img_value = summary_pb2.Summary.Value(
              tag="{}/{}".format(tf_name, i), image=img_sum
          )
          img_summaries.append(img_value)
          summary = summary_pb2.Summary()
          summary.value.add(tag=tf_name, image=img_sum)
  
      summary = summary_pb2.Summary(value=img_summaries)
      return summary
  
imports: from collections import defaultdict
  import os
  import re
  import socket
  import struct
  import time
  import numpy
  import six
  import scipy.misc
  from .crc32c import crc32c
label_desc: Use image node_id 7 for calling the Logger obj's underlying member method code with example usage: obj._image_summary(tf_name, images, step) and returns: summary