The simplest possible memory planner that just lays out all buffers at increasing offsets without trying to reuse memory.
tensorflow/lite/micro/memory_planner/linear_memory_planner.h:27
class LinearMemoryPlanner : public tflite::micro::MicroMemoryPlannerThe simplest possible memory planner that just lays out all buffers at increasing offsets without trying to reuse memory.
tensorflow/lite/micro/memory_planner/linear_memory_planner.h:29
tflite::micro::LinearMemoryPlanner::LinearMemoryPlanner()tensorflow/lite/micro/memory_planner/linear_memory_planner.h:30
tflite::micro::LinearMemoryPlanner::~LinearMemoryPlanner()AddBuffer
C++Pass information about a buffer's size and lifetime to the layout algorithm.
tensorflow/lite/micro/memory_planner/linear_memory_planner.h:32
TfLiteStatus tflite::micro::LinearMemoryPlanner::AddBuffer(int size, int first_time_used, int last_time_used)Pass information about a buffer’s size and lifetime to the layout algorithm. The order this is called implicitly assigns an index to the result, so the buffer information that’s passed into the N-th call of this method will be used as the buffer_index argument to GetOffsetForBuffer().
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
size | int | Required | |
first_time_used | int | Required | |
last_time_used | int | Required |
The largest contiguous block of memory that's needed to hold the layout.
tensorflow/lite/micro/memory_planner/linear_memory_planner.h:35
size_t tflite::micro::LinearMemoryPlanner::GetMaximumMemorySize()The largest contiguous block of memory that’s needed to hold the layout.
How many buffers have been added to the planner.
tensorflow/lite/micro/memory_planner/linear_memory_planner.h:36
int tflite::micro::LinearMemoryPlanner::GetBufferCount()How many buffers have been added to the planner.
Calculated layout offset for the N-th buffer added to the planner.
tensorflow/lite/micro/memory_planner/linear_memory_planner.h:37
TfLiteStatus tflite::micro::LinearMemoryPlanner::GetOffsetForBuffer(int buffer_index, int *offset)Calculated layout offset for the N-th buffer added to the planner.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
buffer_index | int | Required | |
offset | int * | Required |
Returns True because the LinearMemoryPlanner preserves all tensors after invocation.
tensorflow/lite/micro/memory_planner/linear_memory_planner.h:41
bool tflite::micro::LinearMemoryPlanner::preserves_all_tensors() constReturns True because the LinearMemoryPlanner preserves all tensors after invocation.