| 54 | } |
| 55 | |
| 56 | TfLiteStatus Populate(const string& filename, |
| 57 | std::vector<std::vector<float>>* tensors) { |
| 58 | if (filename.empty()) { |
| 59 | fprintf(stderr, "Empty input file name."); |
| 60 | return kTfLiteError; |
| 61 | } |
| 62 | |
| 63 | std::ifstream file(filename); |
| 64 | string content; |
| 65 | while (std::getline(file, content, '\n')) { |
| 66 | tensors->push_back(Split<float>(content, ",")); |
| 67 | } |
| 68 | |
| 69 | file.close(); |
| 70 | return kTfLiteOk; |
| 71 | } |
| 72 | } // namespace |
| 73 | |
| 74 | TfLiteStatus DiffAnalyzer::ReadFiles(const string& base, const string& test) { |