| 218 | } |
| 219 | |
| 220 | std::unique_ptr<InputDataLoader> makeDataLoader(const std::string &file_path, |
| 221 | const InputFormat &format, |
| 222 | const std::vector<loco::Node *> &input_nodes) |
| 223 | { |
| 224 | switch (format) |
| 225 | { |
| 226 | case InputFormat::H5: |
| 227 | { |
| 228 | return std::make_unique<HDF5Loader>(file_path, input_nodes); |
| 229 | } |
| 230 | case InputFormat::DIR: |
| 231 | { |
| 232 | return std::make_unique<DirectoryLoader>(file_path, input_nodes); |
| 233 | } |
| 234 | default: |
| 235 | throw std::runtime_error{"Unsupported input format."}; |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | } // namespace circle_eval_diff |