Skip to content

Commit b75c6ff

Browse files
authored
Automated sync from github.com/tensorflow/tensorflow (#3176)
BUG=automated sync from upstream NO_CHECK_TFLITE_FILES=automated sync from upstream
1 parent 2b3f8d0 commit b75c6ff

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

tensorflow/lite/array.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ limitations under the License.
2020
namespace tflite {
2121
namespace array_internal {
2222

23+
#ifndef TF_LITE_STATIC_MEMORY
2324
void 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

tensorflow/lite/array.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ using FloatArrayUniquePtr = TfLiteArrayUniquePtr<float>;
7070
template <class T = int>
7171
TfLiteArrayUniquePtr<T> BuildTfLiteArray(int size);
7272

73+
#ifndef TF_LITE_STATIC_MEMORY
7374
// Allocates a TfLiteIntArray of given size using malloc.
7475
template <>
7576
inline IntArrayUniquePtr BuildTfLiteArray<int>(const int size) {
@@ -81,6 +82,7 @@ template <>
8182
inline 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.

0 commit comments

Comments
 (0)