@@ -25,10 +25,10 @@ limitations under the License.
2525#include " tensorflow/lite/micro/memory_planner/non_persistent_buffer_planner_shim.h"
2626#include " tensorflow/lite/micro/micro_allocator.h"
2727#include " tensorflow/lite/micro/micro_arena_constants.h"
28+ #include " tensorflow/lite/micro/micro_interpreter.h"
2829#include " tensorflow/lite/micro/test_helpers.h"
2930#include " tensorflow/lite/micro/testing/micro_test.h"
3031#include " tensorflow/lite/micro/testing/test_conv_model.h"
31- #include " tensorflow/lite/micro/micro_interpreter.h"
3232
3333namespace tflite {
3434namespace testing {
@@ -1424,9 +1424,8 @@ TF_LITE_MICRO_TEST(TestInitializeTensorInvalidBufferIndex) {
14241424 simple_allocator, simple_allocator, /* allocate_temp=*/ false ,
14251425 *bad_tensor, buffers, &out_tensor));
14261426 TF_LITE_MICRO_EXPECT_EQ (
1427- kTfLiteError ,
1428- tflite::internal::InitializeTfLiteEvalTensorFromFlatbuffer (
1429- *bad_tensor, buffers, &out_eval_tensor));
1427+ kTfLiteError , tflite::internal::InitializeTfLiteEvalTensorFromFlatbuffer (
1428+ *bad_tensor, buffers, &out_eval_tensor));
14301429}
14311430
14321431TF_LITE_MICRO_TEST (TestModelAllocationSubgraphInvalidBufferIndex) {
@@ -1437,7 +1436,8 @@ TF_LITE_MICRO_TEST(TestModelAllocationSubgraphInvalidBufferIndex) {
14371436 flatbuffers::FlatBufferBuilder fbb;
14381437
14391438 // One empty buffer at index 0 in Model.buffers().
1440- flatbuffers::Offset<tflite::Buffer> buffers_arr[1 ] = {tflite::CreateBuffer (fbb)};
1439+ flatbuffers::Offset<tflite::Buffer> buffers_arr[1 ] = {
1440+ tflite::CreateBuffer (fbb)};
14411441 auto buffers_fb = fbb.CreateVector (buffers_arr, 1 );
14421442
14431443 // Tensor with invalid buffer index.
@@ -1455,17 +1455,18 @@ TF_LITE_MICRO_TEST(TestModelAllocationSubgraphInvalidBufferIndex) {
14551455 auto outputs = fbb.CreateVector (outputs_idx, 1 );
14561456 auto inputs = fbb.CreateVector <int32_t >({});
14571457 auto ops = fbb.CreateVector <flatbuffers::Offset<tflite::Operator>>({});
1458- auto subgraph = tflite::CreateSubGraph (
1459- fbb, tensors_vec, inputs, outputs, ops, fbb.CreateString (" sg0" ));
1458+ auto subgraph = tflite::CreateSubGraph (fbb, tensors_vec, inputs, outputs, ops,
1459+ fbb.CreateString (" sg0" ));
14601460 auto subgraphs = fbb.CreateVector (&subgraph, 1 );
14611461
14621462 // Minimal model (no operator codes needed as there are no operators).
1463- auto model = tflite::CreateModel (
1464- fbb, /* version=*/ TFLITE_SCHEMA_VERSION,
1465- /* operator_codes=*/ 0 , subgraphs, fbb. CreateString ( " invalid_buf_model " ) ,
1466- buffers_fb);
1463+ auto model =
1464+ tflite::CreateModel ( fbb, /* version=*/ TFLITE_SCHEMA_VERSION,
1465+ /* operator_codes=*/ 0 , subgraphs,
1466+ fbb. CreateString ( " invalid_buf_model " ), buffers_fb);
14671467 tflite::FinishModelBuffer (fbb, model);
1468- const tflite::Model* m = flatbuffers::GetRoot<tflite::Model>(fbb.GetBufferPointer ());
1468+ const tflite::Model* m =
1469+ flatbuffers::GetRoot<tflite::Model>(fbb.GetBufferPointer ());
14691470
14701471 // Allocate an arena and create the allocator.
14711472 constexpr size_t arena_size = 2048 ;
@@ -1476,7 +1477,8 @@ TF_LITE_MICRO_TEST(TestModelAllocationSubgraphInvalidBufferIndex) {
14761477
14771478 // StartModelAllocation should fail (return nullptr) because initializing
14781479 // any eval tensor with an invalid buffer index returns kTfLiteError.
1479- tflite::SubgraphAllocations* subgraph_allocations = allocator->StartModelAllocation (m);
1480+ tflite::SubgraphAllocations* subgraph_allocations =
1481+ allocator->StartModelAllocation (m);
14801482 TF_LITE_MICRO_EXPECT (nullptr == subgraph_allocations);
14811483}
14821484
0 commit comments