| 202 | #undef CHECK_NOT_NULL |
| 203 | |
| 204 | std::vector<std::unique_ptr<ParsedTensor>> parse(const char *info_path) |
| 205 | { |
| 206 | std::ifstream infile; |
| 207 | infile.open(info_path); |
| 208 | |
| 209 | if (infile.fail()) |
| 210 | { |
| 211 | throw oops::UserExn("Fail to open file", "path", info_path); |
| 212 | } |
| 213 | |
| 214 | std::vector<std::unique_ptr<ParsedTensor>> tensors; |
| 215 | |
| 216 | std::string line; |
| 217 | while (std::getline(infile, line)) |
| 218 | { |
| 219 | auto tensor = parse_line(line); |
| 220 | if (tensor) |
| 221 | tensors.emplace_back(std::move(tensor)); |
| 222 | } |
| 223 | |
| 224 | return tensors; |
| 225 | } |
| 226 | |
| 227 | } // namespace tftestinfo |
| 228 | } // namespace support |
no test coverage detected