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

Method ClearMatchedKeys

tensorflow/core/framework/hash_table/hash_table.cc:656–679  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654}
655
656void CoalescedHashTable::ClearMatchedKeys(
657 const std::function<bool(int64)>& match,
658 const std::function<void(Status)>& done) {
659 mutex_lock lock(update_mu_);
660 std::vector<int64> ids;
661 for (int64 i = 0; i < num_tables_; ++i) {
662 for (auto iter = tables_[i].begin(); iter != tables_[i].end(); ) {
663 if (match(iter->first)) {
664 ids.push_back(iter->second);
665 iter = tables_[i].erase(iter);
666 if (ids.back() != kNotAdmitted) {
667 ids_allocator_.FreeId(ids.back());
668 }
669 } else {
670 ++iter;
671 }
672 }
673 }
674 StatusCollector* stc = new StatusCollector(tensors_.size(), done);
675 for (auto&& tensor : tensors_) {
676 tensor->ClearIds(ids.data(), ids.size(), stc->AddStatusFunc());
677 }
678 stc->Start();
679}
680
681} // namespace tensorflow

Callers

nothing calls this directly

Calls 11

FreeIdMethod · 0.80
ClearIdsMethod · 0.80
AddStatusFuncMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
eraseMethod · 0.45
backMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected