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

Method MaybeResize

tensorflow/core/lib/gtl/flatrep.h:219–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217 }
218
219 inline void MaybeResize() {
220 if (not_empty_ < grow_) {
221 return; // Nothing to do
222 }
223 if (grow_ == 0) {
224 // Special value set by erase to cause shrink on next insert.
225 if (size() >= shrink_) {
226 // Not small enough to shrink.
227 grow_ = static_cast<size_t>(bucket_count() * 0.8);
228 if (not_empty_ < grow_) return;
229 }
230 }
231 Resize(size() + 1);
232 }
233
234 void Resize(size_t N) {
235 Bucket* old = array_;

Callers 4

InsertMethod · 0.80
FlatMapClass · 0.80
emplaceMethod · 0.80
InsertMethod · 0.80

Calls 2

sizeFunction · 0.50
ResizeFunction · 0.50

Tested by

no test coverage detected