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

Method Cleanup

tensorflow/core/framework/resource_mgr.cc:243–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243Status ResourceMgr::Cleanup(const string& container) {
244 {
245 tf_shared_lock l(mu_);
246 if (!gtl::FindOrNull(containers_, container)) {
247 // Nothing to cleanup.
248 return Status::OK();
249 }
250 }
251 Container* b = nullptr;
252 {
253 mutex_lock l(mu_);
254 auto iter = containers_.find(container);
255 if (iter == containers_.end()) {
256 // Nothing to cleanup, it's OK (concurrent cleanup).
257 return Status::OK();
258 }
259 b = iter->second;
260 containers_.erase(iter);
261 }
262 CHECK(b != nullptr);
263 delete b;
264 return Status::OK();
265}
266
267static bool IsValidContainerName(StringPiece s) {
268 using ::tensorflow::strings::Scanner;

Callers 8

TESTFunction · 0.45
RunFunctionMethod · 0.45
TryInitMethod · 0.45
RunMethod · 0.45
RunWithBorrowedArgsMethod · 0.45
RunInstantiatedMethod · 0.45
RunAsyncMethod · 0.45
ProduceMethod · 0.45

Calls 4

FindOrNullFunction · 0.85
findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by 1

TESTFunction · 0.36