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

Method GetIds

tensorflow/core/framework/hash_table/hash_table.cc:71–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71void HashTable::IdsAllocator::GetIds(int64 count, IdsContainer* ids) {
72 count -= ids->Size();
73 if (count <= 0) return;
74 if (free_list_.empty()) {
75 ids->region_list_.emplace_back();
76 ids->region_list_.back().start = counter_;
77 counter_ += count;
78 ids->region_list_.back().end = counter_;
79 return;
80 }
81 int64 from_list = count <= free_list_.size() ? count : free_list_.size();
82 ids->id_list_.insert(ids->id_list_.end(),
83 free_list_.begin(), free_list_.begin() + from_list);
84 free_list_.erase(free_list_.begin(), free_list_.begin() + from_list);
85
86 int64 left = count - from_list;
87 if (left <= 0) return;
88 ids->region_list_.emplace_back();
89 ids->region_list_.back().start = counter_;
90 counter_ += left;
91 ids->region_list_.back().end = counter_;
92}
93
94void HashTable::IdsAllocator::GetId(int64* id) {
95 if (free_list_.empty()) {

Callers 5

TESTFunction · 0.80
ComputeAsyncMethod · 0.80
ComputeAsyncMethod · 0.80

Calls 14

New64Function · 0.85
AddStatusFuncMethod · 0.80
minFunction · 0.50
SizeMethod · 0.45
emptyMethod · 0.45
emplace_backMethod · 0.45
backMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45

Tested by 1

TESTFunction · 0.64