| 47 | } |
| 48 | |
| 49 | void deallocate_buffer(void* data, size_t len, void* arg) { |
| 50 | Allocator* allocator = nullptr; |
| 51 | if (arg == nullptr) { |
| 52 | allocator = cpu_allocator(); |
| 53 | } else { |
| 54 | allocator = reinterpret_cast<Allocator*>(arg); |
| 55 | } |
| 56 | if (LogMemory::IsEnabled() && data != nullptr) { |
| 57 | LogMemory::RecordRawDeallocation( |
| 58 | "TensorFlow C Api", LogMemory::EXTERNAL_TENSOR_ALLOCATION_STEP_ID, data, |
| 59 | allocator, false); |
| 60 | } |
| 61 | allocator->DeallocateRaw(data); |
| 62 | } |
| 63 | } // namespace tensorflow |
| 64 | |
| 65 | namespace { |
nothing calls this directly
no test coverage detected