Skip to content

Commit 83a5458

Browse files
Style improvements to pass CI/CD checks
1 parent 381d92c commit 83a5458

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

tensorflow/lite/micro/kernels/arc_mli/mli_interface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class MliTensorInterface {
3333
public:
3434
// Make sure that lifetime of MliTensorInterface instance isn't bigger than
3535
// related mli_tensor.
36-
MliTensorInterface(mli_tensor* tensor) : tensor_(tensor) {};
36+
MliTensorInterface(mli_tensor* tensor) : tensor_(tensor){};
3737
MliTensorInterface() = default;
3838
~MliTensorInterface() = default;
3939

tensorflow/lite/micro/kernels/reduce_common.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ enum MinMaxEvalType { kEvalMin, kEvalMax };
120120
template <typename T>
121121
struct MinMaxReducerCompare {
122122
MinMaxReducerCompare() = delete;
123-
MinMaxReducerCompare(MinMaxEvalType evalType) : type_(evalType) {};
123+
MinMaxReducerCompare(MinMaxEvalType evalType) : type_(evalType){};
124124

125125
constexpr T initialValue() const {
126126
return (type_ == kEvalMin) ? std::numeric_limits<T>::max()

tensorflow/lite/micro/micro_allocator.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ TfLiteStatus MicroAllocator::PopulateTfLiteTensorFromFlatbuffer(
11341134
// TODO(b/162311891): This method serves as a stub to ensure quantized
11351135
// allocations in the tail can be recorded. Once the interpreter has APIs for
11361136
// accessing buffers on TfLiteEvalTensor this method can be dropped.
1137-
1137+
11381138
// Validate subgraph and tensor indices before dereferencing FlatBuffer
11391139
// vectors to avoid out-of-bounds access.
11401140
if (subgraph_idx < 0 ||
@@ -1159,8 +1159,9 @@ TfLiteStatus MicroAllocator::PopulateTfLiteTensorFromFlatbuffer(
11591159
const tflite::Tensor* flatbuffer_tensor =
11601160
subgraph->tensors()->Get(tensor_index);
11611161

1162-
// Buffer index validation is performed in InitializeTfLiteTensorFromFlatbuffer
1163-
// but we also ensure model->buffers() is non-null here for completeness.
1162+
// Buffer index validation is performed in
1163+
// InitializeTfLiteTensorFromFlatbuffer but we also ensure model->buffers() is
1164+
// non-null here for completeness.
11641165
if (model->buffers() == nullptr) {
11651166
MicroPrintf("Model buffers vector is null");
11661167
return kTfLiteError;

tensorflow/lite/micro/micro_allocator_test.cc

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

3333
namespace tflite {
3434
namespace 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

14321431
TF_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

Comments
 (0)