| 486 | |
| 487 | template <typename T> |
| 488 | std::vector<size_t> ValidationOutputAccessor::access_predictions_tensor(arm_compute::ITensor &tensor) |
| 489 | { |
| 490 | // Get the predicted class |
| 491 | std::vector<size_t> index; |
| 492 | |
| 493 | const auto output_net = reinterpret_cast<T *>(tensor.buffer() + tensor.info()->offset_first_element_in_bytes()); |
| 494 | const size_t num_classes = tensor.info()->dimension(0); |
| 495 | |
| 496 | index.resize(num_classes); |
| 497 | |
| 498 | // Sort results |
| 499 | std::iota(std::begin(index), std::end(index), static_cast<size_t>(0)); |
| 500 | std::sort(std::begin(index), std::end(index), [&](size_t a, size_t b) { return output_net[a] > output_net[b]; }); |
| 501 | |
| 502 | return index; |
| 503 | } |
| 504 | |
| 505 | void ValidationOutputAccessor::aggregate_sample(const std::vector<size_t> &res, |
| 506 | size_t &positive_samples, |
nothing calls this directly
no test coverage detected