Generates appropriate output accessor according to the specified graph parameters * * @note If the output accessor is requested to validate the graph then ValidationOutputAccessor is generated * else if output_accessor_file is empty will generate a DummyAccessor else will generate a TopNPredictionsAccessor * * @param[in] graph_parameters Graph parameters * @param[in] top_n
| 546 | * @return An appropriate tensor accessor |
| 547 | */ |
| 548 | inline std::unique_ptr<graph::ITensorAccessor> |
| 549 | get_output_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, |
| 550 | size_t top_n = 5, |
| 551 | bool is_validation = false, |
| 552 | std::ostream &output_stream = std::cout) |
| 553 | { |
| 554 | ARM_COMPUTE_UNUSED(is_validation); |
| 555 | if (!graph_parameters.validation_file.empty()) |
| 556 | { |
| 557 | return std::make_unique<ValidationOutputAccessor>(graph_parameters.validation_file, output_stream, |
| 558 | graph_parameters.validation_range_start, |
| 559 | graph_parameters.validation_range_end); |
| 560 | } |
| 561 | else if (graph_parameters.labels.empty()) |
| 562 | { |
| 563 | return std::make_unique<DummyAccessor>(0); |
| 564 | } |
| 565 | else |
| 566 | { |
| 567 | return std::make_unique<TopNPredictionsAccessor>(graph_parameters.labels, top_n, output_stream); |
| 568 | } |
| 569 | } |
| 570 | /** Generates appropriate output accessor according to the specified graph parameters |
| 571 | * |
| 572 | * @note If the output accessor is requested to validate the graph then ValidationOutputAccessor is generated |
no test coverage detected