Exemple #1
0
 def scalar(self, *args, **kwargs):
     kwargs.setdefault('step', 1)
     writer = tf2.summary.create_file_writer(self.get_temp_dir())
     with writer.as_default():
         summary.scalar(*args, **kwargs)
     writer.close()
     return self.read_single_event_from_eventfile().summary
Exemple #2
0
 def scalar_event(self, *args, **kwargs):
     writer = tf.contrib.summary.create_file_writer(self.get_temp_dir())
     with writer.as_default(), tf.contrib.summary.always_record_summaries():
         summary.scalar(*args, **kwargs)
     return self.read_single_event_from_eventfile()
Exemple #3
0
 def graph_fn():
     # Recreate the active scope inside the defun since it won't propagate.
     with tf.name_scope(scope):
         summary.scalar(*args, **kwargs)
Exemple #4
0
 def write_scalar_event(self, *args, **kwargs):
     kwargs.setdefault("step", 1)
     writer = tf2.summary.create_file_writer(self.get_temp_dir())
     with writer.as_default():
         summary.scalar(*args, **kwargs)
     writer.close()