File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ limitations under the License.
2020namespace tflite {
2121namespace array_internal {
2222
23+ #ifndef TF_LITE_STATIC_MEMORY
2324void TfLiteArrayDeleter::operator ()(TfLiteIntArray* a) {
2425 if (a) {
2526 TfLiteIntArrayFree (a);
@@ -30,6 +31,7 @@ void TfLiteArrayDeleter::operator()(TfLiteFloatArray* a) {
3031 TfLiteFloatArrayFree (a);
3132 }
3233}
34+ #endif // TF_LITE_STATIC_MEMORY
3335
3436} // namespace array_internal
3537} // namespace tflite
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ using FloatArrayUniquePtr = TfLiteArrayUniquePtr<float>;
7070template <class T = int >
7171TfLiteArrayUniquePtr<T> BuildTfLiteArray (int size);
7272
73+ #ifndef TF_LITE_STATIC_MEMORY
7374// Allocates a TfLiteIntArray of given size using malloc.
7475template <>
7576inline IntArrayUniquePtr BuildTfLiteArray<int >(const int size) {
@@ -81,6 +82,7 @@ template <>
8182inline FloatArrayUniquePtr BuildTfLiteArray<float >(const int size) {
8283 return FloatArrayUniquePtr (TfLiteFloatArrayCreate (size));
8384}
85+ #endif // TF_LITE_STATIC_MEMORY
8486
8587// Allocates a TFLiteArray of given size and initializes it with the given
8688// values.
You can’t perform that action at this time.
0 commit comments