class_docstr: Writes entries to `Summary` protocol buffer.
code: def __call__(self):
      entries = []
      for tag, value in self.items():
          if isinstance(value, DelayedScalar):
              entries.append(
                  summary_pb2.Summary.Value(
                      tag=tag, simple_value=value()
                  )
              )
          elif isinstance(value, Image):
              image_summary = summary_pb2.Summary.Image(
                  encoded_image_string=value.png,
                  colorspace=value.shape[0],
                  height=value.shape[1],
                  width=value.shape[2],
              )
              entries.append(
                  summary_pb2.Summary.Value(
                      tag=tag, image=image_summary
                  )
              )
          elif isinstance(value, Text):
              metadata = summary_pb2.SummaryMetadata(
                  plugin_data=summary_pb2.SummaryMetadata.PluginData(
                      plugin_name="text"
                  )
              )
              entries.append(
                  summary_pb2.Summary.Value(
                      tag=tag,
                      metadata=metadata,
                      tensor=make_tensor_proto(
                          values=value.text.encode("utf-8"), shape=(1,)
                      ),
                  )
              )
          else:
              raise NotImplementedError(tag, value)
      return summary_pb2.Summary(value=entries)
  
imports: import enum
  import os
  from time import time
  from typing import Union, Callable, Tuple, ByteString
  import numpy
  from tensorboard.compat.proto import event_pb2
  from tensorboard.compat.proto import summary_pb2
  from tensorboard.summary.writer.event_file_writer import EventFileWriter
  from tensorboard.util.tensor_util import make_tensor_proto
  from objax import util
label_desc: Use image node_id 4 for calling the Summary obj's underlying member method code with example usage: obj.__call__() and returns: summary_pb2