Generates appropriate npy output accessor according to the specified npy_path * * @note If npy_path is empty will generate a DummyAccessor else will generate a NpyAccessor * * @param[in] npy_path Path to npy file. * @param[in] shape Shape of the numpy tensor data. * @param[in] data_type DataType of the numpy tensor data. * @param[in] data_layout DataLayout of the nump
| 614 | * @return An appropriate tensor accessor |
| 615 | */ |
| 616 | inline std::unique_ptr<graph::ITensorAccessor> get_npy_output_accessor(const std::string &npy_path, |
| 617 | TensorShape shape, |
| 618 | DataType data_type, |
| 619 | DataLayout data_layout = DataLayout::NCHW, |
| 620 | std::ostream &output_stream = std::cout) |
| 621 | { |
| 622 | if (npy_path.empty()) |
| 623 | { |
| 624 | return std::make_unique<DummyAccessor>(0); |
| 625 | } |
| 626 | else |
| 627 | { |
| 628 | return std::make_unique<NumPyAccessor>(npy_path, shape, data_type, data_layout, output_stream); |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | /** Generates appropriate npy output accessor according to the specified npy_path |
| 633 | * |
no test coverage detected