MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / access_predictions_tensor

Method access_predictions_tensor

utils/GraphUtils.cpp:488–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486
487template <typename T>
488std::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
505void ValidationOutputAccessor::aggregate_sample(const std::vector<size_t> &res,
506 size_t &positive_samples,

Callers

nothing calls this directly

Calls 11

endFunction · 0.85
copyFunction · 0.50
bufferMethod · 0.45
infoMethod · 0.45
dimensionMethod · 0.45
resizeMethod · 0.45
yMethod · 0.45
valid_regionMethod · 0.45
xMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected