Esempio n. 1
0
 def function(tag, scope):
     gen_summary_ops.write_summary(
         context.context().summary_writer_resource,
         training_util.get_global_step(),
         tensor,
         tag,
         metadata,
         name=scope)
Esempio n. 2
0
 def record():
     with summary_op_util.summary_scope(name, family,
                                        values=[tensor]) as (tag, scope):
         gen_summary_ops.write_summary(
             context.context().summary_writer_resource,
             training_util.get_global_step(),
             tensor,
             tag,
             metadata,
             name=scope)
Esempio n. 3
0
 def function(tag, scope):
     # Note the identity to move the tensor to the CPU.
     return gen_summary_ops.write_summary(
         context.context().summary_writer_resource,
         training_util.get_global_step(),
         array_ops.identity(tensor),
         tag,
         metadata,
         name=scope)
Esempio n. 4
0
 def function(tag, scope):
   if metadata is None:
     serialized_metadata = constant_op.constant("")
   elif hasattr(metadata, "SerializeToString"):
     serialized_metadata = constant_op.constant(metadata.SerializeToString())
   else:
     serialized_metadata = metadata
   # Note the identity to move the tensor to the CPU.
   return gen_summary_ops.write_summary(
       context.context().summary_writer_resource,
       global_step, array_ops.identity(tensor),
       tag, serialized_metadata, name=scope)
Esempio n. 5
0
  def generic(self, name, tensor, metadata, family=None):
    """Write a generic-type summary.

    Args:
      name: A name for the generated node. Will also serve as the series name in
        TensorBoard.
      tensor: A `Tensor` or compatible value type containing the value of the
        summary.
      metadata: Metadata about the summary.
      family: Optional; if provided, used as the prefix of the summary tag name,
        which controls the tab name used for display on Tensorboard.
    """
    with context.device(self._CPU_DEVICE):
      with summary_op_util.summary_scope(
          name, family, values=[tensor]) as (tag, scope):
        gen_summary_ops.write_summary(
            self._resource,
            self._update_global_step_tensor(),
            _maybe_cpu(tensor),
            tag,
            _maybe_cpu(metadata),
            name=scope)
Esempio n. 6
0
  def generic(self, name, tensor, metadata, family=None):
    """Write a generic-type summary.

    Args:
      name: A name for the generated node. Will also serve as the series name in
        TensorBoard.
      tensor: A `Tensor` or compatible value type containing the value of the
        summary.
      metadata: Metadata about the summary.
      family: Optional; if provided, used as the prefix of the summary tag name,
        which controls the tab name used for display on Tensorboard.
    """
    with context.device(self._CPU_DEVICE):
      with summary_op_util.summary_scope(
          name, family, values=[tensor]) as (tag, scope):
        gen_summary_ops.write_summary(
            self._resource,
            self._update_global_step_tensor(),
            _maybe_as_cpu_tensor(tensor),
            tag,
            _maybe_as_cpu_tensor(metadata),
            name=scope)
Esempio n. 7
0
 def function(tag, scope):
   # Note the identity to move the tensor to the CPU.
   return gen_summary_ops.write_summary(
       context.context().summary_writer_resource,
       training_util.get_global_step(), array_ops.identity(tensor),
       tag, metadata, name=scope)
Esempio n. 8
0
 def function(tag, scope):
   gen_summary_ops.write_summary(context.context().summary_writer_resource,
                                 training_util.get_global_step(), tensor,
                                 tag, metadata, name=scope)
Esempio n. 9
0
 def record():
   with summary_op_util.summary_scope(
       name, family, values=[tensor]) as (tag, scope):
     gen_summary_ops.write_summary(context.context().summary_writer_resource,
                                   training_util.get_global_step(), tensor,
                                   tag, metadata, name=scope)