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

Method DropFromTable

tensorflow/core/common_runtime/scoped_allocator.cc:147–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void ScopedAllocatorInstance::DropFromTable() {
148 bool del = false;
149 {
150 mutex_lock l(mu_);
151 CHECK(in_table_);
152 in_table_ = false;
153 VLOG(2) << "ScopedAllocatorInstance::DropFromTable " << this
154 << " allocated_ " << allocated_ << " deallocated_ " << deallocated_
155 << " in_table_ " << in_table_;
156 // Single use is complete when it is allocated and deallocated.
157 // This check prevents a race between Allocating the tensor slice and
158 // Dropping it from the parent container's table.
159 if (allocated_ && deallocated_) {
160 del = true;
161 }
162 }
163 if (del) delete this;
164}
165
166void* ScopedAllocatorInstance::AllocateRaw(size_t alignment, size_t num_bytes) {
167 void* ptr = scoped_allocator_->AllocateRaw(field_index_, num_bytes);

Callers 2

DropMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected