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

Method DoLookup

tensorflow/core/framework/resource_mgr.cc:192–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192Status ResourceMgr::DoLookup(const string& container, TypeIndex type,
193 const string& name,
194 ResourceBase** resource) const {
195 const Container* b = gtl::FindPtrOrNull(containers_, container);
196 if (b == nullptr) {
197 return errors::NotFound("Container ", container,
198 " does not exist. (Could not find resource: ",
199 container, "/", name, ")");
200 }
201 auto iter = b->find({type.hash_code(), name});
202 if (iter == b->end()) {
203 return errors::NotFound("Resource ", container, "/", name, "/", type.name(),
204 " does not exist.");
205 }
206 *resource = const_cast<ResourceBase*>(iter->second.resource.get());
207 (*resource)->Ref();
208 return Status::OK();
209}
210
211Status ResourceMgr::DoDelete(const string& container, uint64 type_hash_code,
212 const string& resource_name,

Callers

nothing calls this directly

Calls 8

FindPtrOrNullFunction · 0.85
NotFoundFunction · 0.85
nameMethod · 0.65
findMethod · 0.45
hash_codeMethod · 0.45
endMethod · 0.45
getMethod · 0.45
RefMethod · 0.45

Tested by

no test coverage detected