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

Method Extract

tensorflow/core/lib/gtl/top_n.h:279–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 8

TestIntTopNHelperFunction · 0.45
TESTFunction · 0.45
ComputeMethod · 0.45
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 2

TestIntTopNHelperFunction · 0.36
TESTFunction · 0.36