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

Method TopNPredictionsAccessor

utils/GraphUtils.cpp:600–623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598}
599
600TopNPredictionsAccessor::TopNPredictionsAccessor(const std::string &labels_path,
601 size_t top_n,
602 std::ostream &output_stream)
603 : _labels(), _output_stream(output_stream), _top_n(top_n)
604{
605 _labels.clear();
606
607 std::ifstream ifs;
608
609 try
610 {
611 ifs.exceptions(std::ifstream::badbit);
612 ifs.open(labels_path, std::ios::in | std::ios::binary);
613
614 for (std::string line; !std::getline(ifs, line).fail();)
615 {
616 _labels.emplace_back(line);
617 }
618 }
619 catch (const std::ifstream::failure &e)
620 {
621 ARM_COMPUTE_ERROR_VAR("Accessing %s: %s", labels_path.c_str(), e.what());
622 }
623}
624
625template <typename T>
626void TopNPredictionsAccessor::access_predictions_tensor(ITensor &tensor)

Callers

nothing calls this directly

Calls 3

clearMethod · 0.45
openMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected