| 33 | |
| 34 | namespace tensorflow { |
| 35 | void* allocate_tensor(const char* operation, size_t len, Allocator* allocator) { |
| 36 | void* data = allocator->AllocateRaw(EIGEN_MAX_ALIGN_BYTES, len); |
| 37 | if (LogMemory::IsEnabled() && data != nullptr) { |
| 38 | LogMemory::RecordRawAllocation( |
| 39 | operation, LogMemory::EXTERNAL_TENSOR_ALLOCATION_STEP_ID, len, data, |
| 40 | allocator); |
| 41 | } |
| 42 | return data; |
| 43 | } |
| 44 | |
| 45 | void* allocate_tensor(const char* operation, size_t len) { |
| 46 | return allocate_tensor(operation, len, cpu_allocator()); |
no test coverage detected