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

Method update

tensorflow/core/framework/embedding/cache.h:180–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178 }
179
180 void update(const K* batch_ids, size_t batch_size,
181 bool use_locking=true) {
182 mutex temp_mu;
183 auto lock = BatchCache<K>::maybe_lock_cache(mu_, temp_mu, use_locking);
184 for (size_t i = 0; i < batch_size; ++i) {
185 K id = batch_ids[i];
186 typename std::map<K, LRUNode *>::iterator it = mp.find(id);
187 if (it != mp.end()) {
188 LRUNode *node = it->second;
189 node->pre->next = node->next;
190 node->next->pre = node->pre;
191 head->next->pre = node;
192 node->next = head->next;
193 head->next = node;
194 node->pre = head;
195 BatchCache<K>::num_hit++;
196 } else {
197 LRUNode *newNode = new LRUNode(id);
198 head->next->pre = newNode;
199 newNode->next = head->next;
200 head->next = newNode;
201 newNode->pre = head;
202 mp[id] = newNode;
203 BatchCache<K>::num_miss++;
204 }
205 }
206 }
207
208 void update(const K* batch_ids, size_t batch_size,
209 const int64* batch_version,

Callers 11

matchAndRewriteMethod · 0.45
_random_typesMethod · 0.45
UpdateCacheMethod · 0.45
RestoreFeaturesMethod · 0.45
DramToSsdBatchCommitMethod · 0.45
RestoreMethod · 0.45
RestoreFeaturesMethod · 0.45
RestoreMethod · 0.45
RestoreFeaturesMethod · 0.45
UpdateCacheMethod · 0.45
TESTFunction · 0.45

Calls 3

updateFunction · 0.50
findMethod · 0.45
endMethod · 0.45

Tested by 2

_random_typesMethod · 0.36
TESTFunction · 0.36