From 6d083483ba28c79ddcb0a5112ce1e58d9af9b784 Mon Sep 17 00:00:00 2001 From: Kun Lu Date: Tue, 20 Jul 2021 18:21:38 -0400 Subject: [PATCH] Fix incorrect values in recorded_allocation on BE machines (#303) Use base class version of AllocateFromTail() instead of derived class version in FlatBufferVectorToTfLiteTypeArray() to solve the issue Signed-off-by: Kun-Lu --- tensorflow/lite/micro/micro_allocator.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tensorflow/lite/micro/micro_allocator.cc b/tensorflow/lite/micro/micro_allocator.cc index 771f0204..c90ac3ea 100644 --- a/tensorflow/lite/micro/micro_allocator.cc +++ b/tensorflow/lite/micro/micro_allocator.cc @@ -370,8 +370,8 @@ TfLiteStatus FlatBufferVectorToTfLiteTypeArray( // Big-endian architecture can not use the same memory layout as // flatbuffers::Vector. Allocate from the tail and // copy values from the flatbuffer into the newly allocated chunk. - kTfLiteArrayType* array = - reinterpret_cast(allocator->AllocateFromTail( + kTfLiteArrayType* array = reinterpret_cast( + allocator->SimpleMemoryAllocator::AllocateFromTail( TfLiteIntArrayGetSizeInBytes(flatbuffer_array->size()), alignof(kTfLiteArrayType))); if (array == nullptr) { -- GitLab