Generates appropriate weights accessor according to the specified path * * @note If path is empty will generate a DummyAccessor else will generate a NumPyBinLoader * * @param[in] path Path to the data files * @param[in] data_file Relative path to the data files from path * @param[in] file_layout (Optional) Layout of file. Defaults to NCHW * * @return An appropriate tensor accessor
| 481 | * @return An appropriate tensor accessor |
| 482 | */ |
| 483 | inline std::unique_ptr<graph::ITensorAccessor> |
| 484 | get_weights_accessor(const std::string &path, const std::string &data_file, DataLayout file_layout = DataLayout::NCHW) |
| 485 | { |
| 486 | if (path.empty()) |
| 487 | { |
| 488 | return std::make_unique<DummyAccessor>(); |
| 489 | } |
| 490 | else |
| 491 | { |
| 492 | return std::make_unique<NumPyBinLoader>(path + data_file, file_layout); |
| 493 | } |
| 494 | } |
| 495 | |
| 496 | /** Generates appropriate input accessor according to the specified graph parameters |
| 497 | * |
no test coverage detected