MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Extract

Method Extract

tensorflow/lite/experimental/kernels/top_n.h:273–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271
272template <class T, class Cmp>
273std::vector<T> *TopN<T, Cmp>::Extract() {
274 auto out = new std::vector<T>;
275 out->swap(elements_);
276 if (state_ != HEAP_SORTED) {
277 std::sort(out->begin(), out->end(), cmp_);
278 } else {
279 out->pop_back();
280 std::sort_heap(out->begin(), out->end(), cmp_);
281 }
282 return out;
283}
284
285template <class T, class Cmp>
286std::vector<T> *TopN<T, Cmp>::ExtractUnsorted() {

Callers 3

DecodeMethod · 0.45
StepMethod · 0.45
TopPathsMethod · 0.45

Calls 5

sortFunction · 0.85
pop_backMethod · 0.80
swapMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected