tensorflow/examples/speech_commands/label_wav.cc
// Takes a file name, and loads a list of labels from it, one per line, and
// returns a vector of the strings.
Takes a file name, and loads a list of labels from it, one per line, and
returns a vector of the strings.
Takes a file name and loads a list of labels from it one per line and returns a vector of the strings .
Status ReadLabelsFile(const string& file_name, std::vector<string>* result) {
  std::ifstream file(file_name);
  if (!file) {
    return tensorflow::errors::NotFound("Labels file ", file_name,
                                        " not found.");
  }
  result->clear();
  string line;
  while (std::getline(file, line)) {
    result->push_back(line);
  }
  return Status::OK();
}
Status ReadLabelsFile ( const string & file_name , std :: vector < string > * result ) { std :: ifstream file ( file_name ) ; if ( ! file ) { return tensorflow :: errors :: NotFound ( " " , file_name , " " ) ; } result -> clear ( ) ; string line ; while ( std :: getline ( file , line ) ) { result -> push_back ( line ) ; } return Status :: OK ( ) ; }
Takes a file name, and loads a list of labels from it, one per line, and
returns a vector of the strings.
Takes a file name and loads a list of labels from it one per line and returns a vector of the strings .