Closed Gostas closed 3 months ago
This define is used in code that is common between TFLite and TFLM to eliminate dynamic memory allocation for TFLM. If your platform supports dynamic memory allocation, then it might work, but the tested path for TFLM is always with TF_LITE_STATIC_MEMORY defined.
I am building an updated version of TFLM for Arduino and wanted to understand the meaning of TF_LITE_STATIC_MEMORY.
The reason is that if I define it, the library won't work correctly - for instance the hello_world example will only output 0. After some debugging I noticed that different versions of some classes like TfLiteNode and TfLiteTensor were used and narrowed it down to the TF_LITE_STATIC_MEMORY define.
In MANIFEST.ini the following files are patched to change TF_LITE_STATIC_MEMORY to ARDUINO:
However the define is still used in the following files.
The Arduino IDE obviously doesn't define TF_LITE_STATIC_MEMORY and it works correctly this way. So is it done on purpose that it is not replaced by ARDUINO in these 3 files?
BTW I found this thread in the Google group: