Skip to content

Commit d332bb8

Browse files
committed
clang-format some existing files
1 parent 600e507 commit d332bb8

File tree

14 files changed

+96
-76
lines changed

14 files changed

+96
-76
lines changed

signal/micro/kernels/stacker_test.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ class StackerKernelRunner {
3232
StackerKernelRunner(int* input_dims_data, const int16_t* input_data,
3333
int* output_dims_data, int16_t* output_data,
3434
int* output_ready_dims_data, bool* ouput_ready_data)
35-
: tensors_{testing::CreateTensor(
36-
input_data,
37-
tflite::testing::IntArrayFromInts(input_dims_data)),
38-
testing::CreateTensor(
39-
output_data,
40-
tflite::testing::IntArrayFromInts(output_dims_data)),
41-
testing::CreateTensor(
42-
ouput_ready_data,
43-
testing::IntArrayFromInts(output_ready_dims_data))},
35+
: tensors_{
36+
testing::CreateTensor(
37+
input_data, tflite::testing::IntArrayFromInts(input_dims_data)),
38+
testing::CreateTensor(
39+
output_data,
40+
tflite::testing::IntArrayFromInts(output_dims_data)),
41+
testing::CreateTensor(
42+
ouput_ready_data,
43+
testing::IntArrayFromInts(output_ready_dims_data))},
4444
inputs_array_{testing::IntArrayFromInts(inputs_array_data_)},
4545
outputs_array_{testing::IntArrayFromInts(outputs_array_data_)},
4646
kernel_runner_{*registration_, tensors_, kTensorsSize,

tensorflow/compiler/mlir/lite/schema/schema_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ namespace tflite {
2424
// problem. The new builtin operator will be assigned to the extended builtin
2525
// code field in the flatbuffer schema. Those methods helps to hide builtin code
2626
// details.
27-
BuiltinOperator GetBuiltinCode(const OperatorCode *op_code);
27+
BuiltinOperator GetBuiltinCode(const OperatorCode* op_code);
2828

29-
BuiltinOperator GetBuiltinCode(const OperatorCodeT *op_code);
29+
BuiltinOperator GetBuiltinCode(const OperatorCodeT* op_code);
3030

3131
} // namespace tflite
3232

tensorflow/lite/experimental/microfrontend/lib/filterbank_test.cc

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckChannelFrequencyStarts) {
7676
kSampleRate, kSpectrumSize));
7777

7878
const int16_t expected[] = {0, 4, 8};
79-
TF_LITE_MICRO_EXPECT_EQ(state.num_channels + 1,
80-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
79+
TF_LITE_MICRO_EXPECT_EQ(
80+
state.num_channels + 1,
81+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
8182
int i;
8283
for (i = 0; i <= state.num_channels; ++i) {
8384
TF_LITE_MICRO_EXPECT_EQ(state.channel_frequency_starts[i], expected[i]);
@@ -93,8 +94,9 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckChannelWeightStarts) {
9394
kSampleRate, kSpectrumSize));
9495

9596
const int16_t expected[] = {0, 8, 16};
96-
TF_LITE_MICRO_EXPECT_EQ(state.num_channels + 1,
97-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
97+
TF_LITE_MICRO_EXPECT_EQ(
98+
state.num_channels + 1,
99+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
98100
int i;
99101
for (i = 0; i <= state.num_channels; ++i) {
100102
TF_LITE_MICRO_EXPECT_EQ(state.channel_weight_starts[i], expected[i]);
@@ -110,8 +112,9 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckChannelWidths) {
110112
kSampleRate, kSpectrumSize));
111113

112114
const int16_t expected[] = {8, 8, 8};
113-
TF_LITE_MICRO_EXPECT_EQ(state.num_channels + 1,
114-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
115+
TF_LITE_MICRO_EXPECT_EQ(
116+
state.num_channels + 1,
117+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
115118
int i;
116119
for (i = 0; i <= state.num_channels; ++i) {
117120
TF_LITE_MICRO_EXPECT_EQ(state.channel_widths[i], expected[i]);
@@ -129,9 +132,10 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckWeights) {
129132
const int16_t expected[] = {0, 3277, 2217, 1200, 222, 0, 0, 0,
130133
0, 3376, 2468, 1591, 744, 0, 0, 0,
131134
0, 4020, 3226, 2456, 1708, 983, 277, 0};
132-
TF_LITE_MICRO_EXPECT_EQ(state.channel_weight_starts[state.num_channels] +
133-
state.channel_widths[state.num_channels],
134-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
135+
TF_LITE_MICRO_EXPECT_EQ(
136+
state.channel_weight_starts[state.num_channels] +
137+
state.channel_widths[state.num_channels],
138+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
135139
for (size_t i = 0; i < sizeof(expected) / sizeof(expected[0]); ++i) {
136140
TF_LITE_MICRO_EXPECT_EQ(state.weights[i], expected[i]);
137141
}
@@ -148,9 +152,10 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckUnweights) {
148152
const int16_t expected[] = {0, 819, 1879, 2896, 3874, 0, 0, 0,
149153
0, 720, 1628, 2505, 3352, 0, 0, 0,
150154
0, 76, 870, 1640, 2388, 3113, 3819, 0};
151-
TF_LITE_MICRO_EXPECT_EQ(state.channel_weight_starts[state.num_channels] +
152-
state.channel_widths[state.num_channels],
153-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
155+
TF_LITE_MICRO_EXPECT_EQ(
156+
state.channel_weight_starts[state.num_channels] +
157+
state.channel_widths[state.num_channels],
158+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
154159
for (size_t i = 0; i < sizeof(expected) / sizeof(expected[0]); ++i) {
155160
TF_LITE_MICRO_EXPECT_EQ(state.unweights[i], expected[i]);
156161
}
@@ -204,8 +209,9 @@ TF_LITE_MICRO_TEST(FilterbankTest_CheckSqrt) {
204209
uint32_t* scaled_filterbank = FilterbankSqrt(&state, kScaleShift);
205210

206211
const uint32_t expected[] = {247311, 508620};
207-
TF_LITE_MICRO_EXPECT_EQ(state.num_channels,
208-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
212+
TF_LITE_MICRO_EXPECT_EQ(
213+
state.num_channels,
214+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
209215
int i;
210216
for (i = 0; i < state.num_channels; ++i) {
211217
TF_LITE_MICRO_EXPECT_EQ(scaled_filterbank[i], expected[i]);

tensorflow/lite/experimental/microfrontend/lib/noise_reduction_test.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ TF_LITE_MICRO_TEST(NoiseReductionTest_TestNoiseReductionEstimate) {
4848
NoiseReductionApply(&state, signal);
4949

5050
const uint32_t expected[] = {6321887, 31248341};
51-
TF_LITE_MICRO_EXPECT_EQ(state.num_channels,
52-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
51+
TF_LITE_MICRO_EXPECT_EQ(
52+
state.num_channels,
53+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
5354
int i;
5455
for (i = 0; i < state.num_channels; ++i) {
5556
TF_LITE_MICRO_EXPECT_EQ(state.estimate[i], expected[i]);
@@ -68,8 +69,9 @@ TF_LITE_MICRO_TEST(NoiseReductionTest_TestNoiseReduction) {
6869
NoiseReductionApply(&state, signal);
6970

7071
const uint32_t expected[] = {241137, 478104};
71-
TF_LITE_MICRO_EXPECT_EQ(state.num_channels,
72-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
72+
TF_LITE_MICRO_EXPECT_EQ(
73+
state.num_channels,
74+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
7375
int i;
7476
for (i = 0; i < state.num_channels; ++i) {
7577
TF_LITE_MICRO_EXPECT_EQ(signal[i], expected[i]);

tensorflow/lite/experimental/microfrontend/lib/pcan_gain_control_test.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ TF_LITE_MICRO_TEST(PcanGainControlTest_TestPcanGainControl) {
5252
PcanGainControlApply(&state, signal);
5353

5454
const uint32_t expected[] = {3578, 1533};
55-
TF_LITE_MICRO_EXPECT_EQ(state.num_channels,
56-
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
55+
TF_LITE_MICRO_EXPECT_EQ(
56+
state.num_channels,
57+
static_cast<int>(sizeof(expected) / sizeof(expected[0])));
5758
int i;
5859
for (i = 0; i < state.num_channels; ++i) {
5960
TF_LITE_MICRO_EXPECT_EQ(signal[i], expected[i]);

tensorflow/lite/kernels/internal/reference/integer_ops/conv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ inline void ConvPerChannel(
135135
}
136136
}
137137

138-
139138
// Fixed-point per-channel-quantization convolution reference kernel.
140139
// 16-bit data and 8-bit filter
141140
template <typename AccumScalar>

tensorflow/lite/micro/cortex_m_corstone_300/system_setup.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ uint32_t GetCurrentTimeTicks() {
104104

105105
#ifdef ETHOS_U
106106
#if defined(ETHOSU_FAST_MEMORY_SIZE) && ETHOSU_FAST_MEMORY_SIZE > 0
107-
__attribute__((aligned(16), section(".bss.ethosu_scratch")))
108-
uint8_t ethosu0_scratch[ETHOSU_FAST_MEMORY_SIZE];
107+
__attribute__((aligned(16), section(".bss.ethosu_scratch"))) uint8_t
108+
ethosu0_scratch[ETHOSU_FAST_MEMORY_SIZE];
109109
#else
110110
#define ethosu0_scratch 0
111111
#define ETHOSU_FAST_MEMORY_SIZE 0

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ typedef mli_status (*conv_func_ptr)(const mli_tensor* /*in*/,
2525
mli_tensor* /*out*/);
2626

2727
#ifdef MLI_2_0
28-
conv_func_ptr __attribute__((weak))
29-
mli_krn_conv2d_hwcn(const mli_tensor* weights) {
28+
conv_func_ptr
29+
__attribute__((weak)) mli_krn_conv2d_hwcn(const mli_tensor* weights) {
3030
int filter_w = weights->shape[KRNL_W_DIM_HWCN];
3131
int filter_h = weights->shape[KRNL_H_DIM_HWCN];
3232

@@ -41,8 +41,9 @@ mli_krn_conv2d_hwcn(const mli_tensor* weights) {
4141
}
4242
}
4343
#else
44-
conv_func_ptr __attribute__((weak))
45-
mli_krn_conv2d_hwcn(const mli_tensor* weights, const mli_conv2d_cfg* cfg) {
44+
conv_func_ptr
45+
__attribute__((weak)) mli_krn_conv2d_hwcn(const mli_tensor* weights,
46+
const mli_conv2d_cfg* cfg) {
4647
return mli_krn_conv2d_nhwc_sa8_sa8_sa32;
4748
}
4849
#endif
@@ -55,8 +56,8 @@ typedef mli_status (*depthwise_func_ptr)(const mli_tensor* /*in*/,
5556
mli_tensor* /*out*/);
5657

5758
#ifdef MLI_2_0
58-
depthwise_func_ptr __attribute__((weak))
59-
mli_krn_depthwise_conv2d(const mli_tensor* weights) {
59+
depthwise_func_ptr
60+
__attribute__((weak)) mli_krn_depthwise_conv2d(const mli_tensor* weights) {
6061
int filter_w = weights->shape[KRNL_DW_W_DIM_HW1N];
6162
int filter_h = weights->shape[KRNL_DW_H_DIM_HW1N];
6263

@@ -69,15 +70,16 @@ mli_krn_depthwise_conv2d(const mli_tensor* weights) {
6970
}
7071
}
7172
#else
72-
depthwise_func_ptr __attribute__((weak))
73-
mli_krn_depthwise_conv2d(const mli_tensor* weights, const mli_conv2d_cfg* cfg) {
73+
depthwise_func_ptr
74+
__attribute__((weak)) mli_krn_depthwise_conv2d(const mli_tensor* weights,
75+
const mli_conv2d_cfg* cfg) {
7476
return mli_krn_depthwise_conv2d_hwcn_sa8_sa8_sa32;
7577
}
7678
#endif
7779

7880
#ifdef MLI_2_0
79-
depthwise_func_ptr __attribute__((weak))
80-
mli_krn_group_conv2d(const mli_tensor* weights) {
81+
depthwise_func_ptr
82+
__attribute__((weak)) mli_krn_group_conv2d(const mli_tensor* weights) {
8183
int filter_w = weights->shape[KRNL_DW_W_DIM_HW1N];
8284
int filter_h = weights->shape[KRNL_DW_H_DIM_HW1N];
8385

@@ -97,8 +99,8 @@ typedef mli_status (*pooling_func_ptr)(const mli_tensor* /*in*/,
9799
mli_tensor* /*out*/);
98100

99101
#ifdef MLI_2_0
100-
pooling_func_ptr __attribute__((weak))
101-
mli_krn_avepool(const mli_pool_cfg* cfg) {
102+
pooling_func_ptr
103+
__attribute__((weak)) mli_krn_avepool(const mli_pool_cfg* cfg) {
102104
int filter_w = cfg->kernel_width;
103105
int filter_h = cfg->kernel_height;
104106

@@ -111,15 +113,15 @@ mli_krn_avepool(const mli_pool_cfg* cfg) {
111113
}
112114
}
113115
#else
114-
pooling_func_ptr __attribute__((weak))
115-
mli_krn_avepool(const mli_pool_cfg* cfg) {
116+
pooling_func_ptr
117+
__attribute__((weak)) mli_krn_avepool(const mli_pool_cfg* cfg) {
116118
return mli_krn_avepool_hwc_sa8;
117119
}
118120
#endif
119121

120122
#ifdef MLI_2_0
121-
pooling_func_ptr __attribute__((weak))
122-
mli_krn_maxpool(const mli_pool_cfg* cfg) {
123+
pooling_func_ptr
124+
__attribute__((weak)) mli_krn_maxpool(const mli_pool_cfg* cfg) {
123125
int filter_w = cfg->kernel_width;
124126
int filter_h = cfg->kernel_height;
125127

@@ -132,8 +134,8 @@ mli_krn_maxpool(const mli_pool_cfg* cfg) {
132134
}
133135
}
134136
#else
135-
pooling_func_ptr __attribute__((weak))
136-
mli_krn_maxpool(const mli_pool_cfg* cfg) {
137+
pooling_func_ptr
138+
__attribute__((weak)) mli_krn_maxpool(const mli_pool_cfg* cfg) {
137139
return mli_krn_maxpool_hwc_sa8;
138140
}
139141
#endif

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/circular_buffer.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ TfLiteStatus CircularBufferEval(TfLiteContext* context, TfLiteNode* node) {
9191
EvalInt8(tflite::micro::GetTensorData<int8_t>(input), num_slots, depth,
9292
tflite::micro::GetTensorData<int8_t>(output));
9393
} else {
94-
MicroPrintf("Type %s (%d) not supported.",
95-
TfLiteTypeGetName(input->type), input->type);
94+
MicroPrintf("Type %s (%d) not supported.", TfLiteTypeGetName(input->type),
95+
input->type);
9696
return kTfLiteError;
9797
}
9898

0 commit comments

Comments
 (0)