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

Method GetInstance

tensorflow/core/common_runtime/scoped_allocator_mgr.cc:73–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73ScopedAllocatorInstance* ScopedAllocatorContainer::GetInstance(int32 scope_id) {
74 VLOG(2) << "GetInstance " << scope_id << " step " << step_id_ << " on "
75 << mgr_->device_name();
76 mutex_lock l(mu_);
77 auto it = allocators_.find(scope_id);
78 if (it != allocators_.end()) {
79 return it->second.instance;
80 }
81 LOG(FATAL) << "Failed to find instance " << scope_id << " in container "
82 << step_id_ << " on " << mgr_->device_name();
83 return nullptr;
84}
85
86void ScopedAllocatorContainer::Drop(int32 scope_id, ScopedAllocator* sa) {
87 VLOG(2) << "Drop " << scope_id << " from container " << this << " step "

Callers 4

SaveInstancesMethod · 0.45
TEST_FFunction · 0.45
GetScopedAllocatorMethod · 0.45
gpu_device.ccFile · 0.45

Calls 3

device_nameMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by 2

SaveInstancesMethod · 0.36
TEST_FFunction · 0.36