| 48 | }; |
| 49 | |
| 50 | static inline std::vector<int> load_shape_file(const std::string & path) { |
| 51 | std::vector<int> shape; |
| 52 | std::ifstream f(path); |
| 53 | if (!f) { |
| 54 | return shape; |
| 55 | } |
| 56 | |
| 57 | std::string line; |
| 58 | std::getline(f, line); |
| 59 | size_t pos = 0; |
| 60 | while (pos < line.size()) { |
| 61 | size_t end = line.find(',', pos); |
| 62 | if (end == std::string::npos) { |
| 63 | end = line.size(); |
| 64 | } |
| 65 | shape.push_back(std::stoi(line.substr(pos, end - pos))); |
| 66 | pos = end + 1; |
| 67 | } |
| 68 | return shape; |
| 69 | } |
| 70 | |
| 71 | static inline ref_tensor_f32 load_ref_f32(const std::string & path) { |
| 72 | ref_tensor_f32 t; |
no outgoing calls
no test coverage detected