tensorflow/core/profiler/rpc/client/save_profile.cc
// Creates an empty event file if not already exists, which indicates that we
// have a plugins/profile/ directory in the current logdir.
Creates an empty event file if not already exists, which indicates that we
have a plugins/profile/ directory in the current logdir.
Creates an empty event file if not already exists which indicates that we have a plugins / profile / directory in the current logdir .
Status MaybeCreateEmptyEventFile(const string& logdir) {
  constexpr char kProfileEmptySuffix[] = ".profile-empty";
  std::vector<string> children;
  TF_RETURN_IF_ERROR(Env::Default()->GetChildren(logdir, &children));
  for (const string& child : children) {
    if (absl::EndsWith(child, kProfileEmptySuffix)) {
      return Status::OK();
    }
  }
  EventsWriter event_writer(io::JoinPath(logdir, "events"));
  return event_writer.InitWithSuffix(kProfileEmptySuffix);
}
Status MaybeCreateEmptyEventFile ( const string & logdir ) { constexpr char kProfileEmptySuffix [ ] = " " ; std :: vector < string > children ; TF_RETURN_IF_ERROR ( Env :: Default ( ) -> GetChildren ( logdir , & children ) ) ; for ( const string & child : children ) { if ( absl :: EndsWith ( child , kProfileEmptySuffix ) ) { return Status :: OK ( ) ; } } EventsWriter event_writer ( io :: JoinPath ( logdir , " " ) ) ; return event_writer . InitWithSuffix ( kProfileEmptySuffix ) ; }
Creates an empty event file if not already exists, which indicates that we
have a plugins/profile/ directory in the current logdir.
Creates an empty event file if not already exists which indicates that we have a plugins / profile / directory in the current logdir .
// Suffix for an empty event file.  it should be kept in sync with // _EVENT_FILE_SUFFIX in tensorflow/python/eager/profiler.py.