Skip to content

Automated sync from github.com/tensorflow/tensorflow #3176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tensorflow/lite/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ limitations under the License.
namespace tflite {
namespace array_internal {

#ifndef TF_LITE_STATIC_MEMORY
void TfLiteArrayDeleter::operator()(TfLiteIntArray* a) {
if (a) {
TfLiteIntArrayFree(a);
Expand All @@ -30,6 +31,7 @@ void TfLiteArrayDeleter::operator()(TfLiteFloatArray* a) {
TfLiteFloatArrayFree(a);
}
}
#endif // TF_LITE_STATIC_MEMORY

} // namespace array_internal
} // namespace tflite
2 changes: 2 additions & 0 deletions tensorflow/lite/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ using FloatArrayUniquePtr = TfLiteArrayUniquePtr<float>;
template <class T = int>
TfLiteArrayUniquePtr<T> BuildTfLiteArray(int size);

#ifndef TF_LITE_STATIC_MEMORY
// Allocates a TfLiteIntArray of given size using malloc.
template <>
inline IntArrayUniquePtr BuildTfLiteArray<int>(const int size) {
Expand All @@ -81,6 +82,7 @@ template <>
inline FloatArrayUniquePtr BuildTfLiteArray<float>(const int size) {
return FloatArrayUniquePtr(TfLiteFloatArrayCreate(size));
}
#endif // TF_LITE_STATIC_MEMORY

// Allocates a TFLiteArray of given size and initializes it with the given
// values.
Expand Down
Loading