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

Method Resize

tensorflow/core/framework/hash_table/hash_table.cc:405–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void HashTable::Resize(int64 size, std::function<void(Status)> done) {
406 if (size_ >= size) {
407 done(Status::OK());
408 return;
409 }
410 AddTask([size, done, this] {
411 if (size_ >= size) {
412 done(Status::OK());
413 RunNext();
414 return;
415 } else {
416 StatusCollector* stc = new StatusCollector(tensors_.size(),
417 [this, size, done] (Status st) {
418 if (st.ok()) {
419 size_ = std::max(size_.load(), size);
420 }
421 done(st);
422 RunNext();
423 });
424 for (auto tensor : tensors_) {
425 tensor->Resize(size, [stc] (Status st) {
426 stc->AddStatus(st);
427 });
428 }
429 stc->Start();
430 }
431 });
432}
433
434void HashTable::AddTask(std::function<void()> task) {
435 bool run;

Callers 2

AddTensibleMethod · 0.45
TESTFunction · 0.45

Calls 6

AddStatusMethod · 0.80
maxFunction · 0.50
sizeMethod · 0.45
okMethod · 0.45
loadMethod · 0.45
StartMethod · 0.45

Tested by 1

TESTFunction · 0.36