def run_metadata(self, *args, **kwargs):
     assert context.executing_eagerly()
     logdir = self.get_temp_dir()
     writer = summary_ops.create_file_writer(logdir)
     with writer.as_default():
         summary_ops.run_metadata(*args, **kwargs)
     writer.close()
     events = events_from_logdir(logdir)
     return events[1]
 def run_metadata(self, *args, **kwargs):
   assert context.executing_eagerly()
   logdir = self.get_temp_dir()
   writer = summary_ops.create_file_writer(logdir)
   with writer.as_default():
     summary_ops.run_metadata(*args, **kwargs)
   writer.close()
   events = events_from_logdir(logdir)
   return events[1]