code: def _image_summary(self, tf_name, images, step=None):
          
          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
docs: 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