(root_dir)
return paths_to_events
Returns all event files from the subdirectories of root_dir.

  Args:
    root_dir: A str. The root directory of evaluation experiments.
  Assumes the following directory organization: root_dir contains a sub-
    directory for every dataset, and each of those contains a directory named
    'summaries' where an event file can be found.
Returns all event files from the subdirectories of root_dir.
Returns all event files from the subdirectories of root_dir .
def get_event_files(root_dir):
  """Returns all event files from the subdirectories of root_dir.

  Args:
    root_dir: A str. The root directory of evaluation experiments.
  Assumes the following directory organization: root_dir contains a sub-
    directory for every dataset, and each of those contains a directory named
    'summaries' where an event file can be found.
  """
  paths_to_events = []
  summaries_dir = os.path.join(root_dir, 'summaries')
  assert tf.io.gfile.isdir(summaries_dir), ('Could not find summaries in %s.' %
                                            root_dir)

  if int(FLAGS.restrict_to_subexperiment) > 0:
    child_dirs = [os.path.join(summaries_dir, FLAGS.restrict_to_subexperiment)]
  else:
    child_dirs = [
        os.path.join(summaries_dir, f)
        for f in tf.io.gfile.listdir(summaries_dir)
    ]
  # Filter out non-directory files, if any.
  child_dirs = [child for child in child_dirs if tf.io.gfile.isdir(child)]
  logging.info('Looking for events in dirs: %s', child_dirs)
  for child_dir in child_dirs:
    for file_name in tf.io.gfile.listdir(child_dir):
      if 'event' in file_name:
        paths_to_events.append(os.path.join(child_dir, file_name))
  logging.info('Found events: %s', paths_to_events)
  return paths_to_events
def get_event_files ( root_dir ) : paths_to_events = [ ] summaries_dir = os . path . join ( root_dir , 'summaries' ) assert tf . io . gfile . isdir ( summaries_dir ) , ( 'Could not find summaries in %s.' % root_dir ) if int ( FLAGS . restrict_to_subexperiment ) > 0 : child_dirs = [ os . path . join ( summaries_dir , FLAGS . restrict_to_subexperiment ) ] else : child_dirs = [ os . path . join ( summaries_dir , f ) for f in tf . io . gfile . listdir ( summaries_dir ) ] # Filter out non-directory files, if any. child_dirs = [ child for child in child_dirs if tf . io . gfile . isdir ( child ) ] logging . info ( 'Looking for events in dirs: %s' , child_dirs ) for child_dir in child_dirs : for file_name in tf . io . gfile . listdir ( child_dir ) : if 'event' in file_name : paths_to_events . append ( os . path . join ( child_dir , file_name ) ) logging . info ( 'Found events: %s' , paths_to_events ) return paths_to_events