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:26
class LinearMemoryPlanner : public tflite::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:28
tflite::LinearMemoryPlanner::LinearMemoryPlanner()tensorflow/lite/micro/memory_planner/linear_memory_planner.h:29
tflite::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:31
TfLiteStatus tflite::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:34
size_t tflite::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:35
int tflite::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:36
TfLiteStatus tflite::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:40
bool tflite::LinearMemoryPlanner::preserves_all_tensors() constReturns True because the LinearMemoryPlanner preserves all tensors after invocation.