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

Method GetIdsWithoutResize

tensorflow/core/framework/hash_table/hash_table.cc:552–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550}
551
552int64 HashTable::GetIdsWithoutResize(int64* keys, int64* ids, int64 size) {
553 mutex_lock lock(update_mu_);
554 for (int64 i = 0; i < size; i++) {
555 int64 table_idx = KeyToTableIdx(keys + i);
556 auto iter = tables_[table_idx].find(keys[i]);
557 if (iter != tables_[table_idx].end() && iter->second != kNotAdmitted) {
558 ids[i] = iter->second;
559 } else {
560 int64 new_id;
561 ids_allocator_.GetId(&new_id);
562 size_++;
563 tables_[table_idx][keys[i]] = new_id;
564 ids[i] = new_id;
565 }
566 }
567 return size_;
568}
569
570namespace {
571constexpr int64 kIndexLen = 52;

Callers 1

InsertTableFunction · 0.80

Calls 3

GetIdMethod · 0.80
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected