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

Method GetAllocator

tensorflow/core/common_runtime/scoped_allocator_mgr.cc:59–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59ScopedAllocator* ScopedAllocatorContainer::GetAllocator(int32 scope_id) {
60 mutex_lock l(mu_);
61 auto it = allocators_.find(scope_id);
62 if (it != allocators_.end()) {
63 CHECK_EQ(ScopedAllocator::kBackingIndex, it->second.field_index);
64 return it->second.scoped_allocator;
65 } else {
66 LOG(ERROR) << "Failed to find ScopedAllocator for " << scope_id
67 << " in container for step " << step_id_ << " on "
68 << mgr_->device_name();
69 return nullptr;
70 }
71}
72
73ScopedAllocatorInstance* ScopedAllocatorContainer::GetInstance(int32 scope_id) {
74 VLOG(2) << "GetInstance " << scope_id << " step " << step_id_ << " on "

Callers

nothing calls this directly

Calls 3

findMethod · 0.45
endMethod · 0.45
device_nameMethod · 0.45

Tested by

no test coverage detected