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

Method DoDelete

tensorflow/core/framework/resource_mgr.cc:211–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211Status ResourceMgr::DoDelete(const string& container, uint64 type_hash_code,
212 const string& resource_name,
213 const string& type_name) {
214 ResourceAndName resource_and_name;
215 {
216 mutex_lock l(mu_);
217 Container* b = gtl::FindPtrOrNull(containers_, container);
218 if (b == nullptr) {
219 return errors::NotFound("Container ", container, " does not exist.");
220 }
221 auto iter = b->find({type_hash_code, resource_name});
222 if (iter == b->end()) {
223 return errors::NotFound("Resource ", container, "/", resource_name, "/",
224 type_name, " does not exist.");
225 }
226 std::swap(resource_and_name, iter->second);
227 b->erase(iter);
228 }
229 DCHECK(resource_and_name.resource != nullptr);
230 return Status::OK();
231}
232
233Status ResourceMgr::DoDelete(const string& container, TypeIndex type,
234 const string& resource_name) {

Callers

nothing calls this directly

Calls 7

FindPtrOrNullFunction · 0.85
NotFoundFunction · 0.85
nameMethod · 0.65
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
hash_codeMethod · 0.45

Tested by

no test coverage detected