Skip to content

Commit a37521a

Browse files
committed
Merge branch 'bugfix/explicit_struct_var_init' into 'master'
Made all initializer clauses explicit See merge request app-frameworks/esp-tflite-micro!159
2 parents 776fca8 + 98b03a6 commit a37521a

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

tensorflow/lite/micro/kernels/esp_nn/conv.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,16 @@ static TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
133133
if (input->type == kTfLiteInt8) {
134134
data_dims_t input_dims = {
135135
.width = input_width, .height = input_height,
136-
.channels = input_channels, 1
136+
.channels = input_channels, .extra = 1
137137
};
138138
data_dims_t output_dims = {
139139
.width = output_width, .height = output_height,
140-
.channels = output->dims->data[3], 1
140+
.channels = output->dims->data[3], .extra = 1
141+
};
142+
data_dims_t filter_dims = {
143+
.width = filter_width, .height = filter_height,
144+
.channels = 0, .extra = 0
141145
};
142-
data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
143146
conv_params_t conv_params = {
144147
.in_offset = 0, .out_offset = 0,
145148
.stride = {params.stride_width, params.stride_height},
@@ -227,13 +230,16 @@ inline void EvalQuantizedPerChannel(
227230

228231
data_dims_t input_dims = {
229232
.width = input_width, .height = input_height,
230-
.channels = input_depth, 1
233+
.channels = input_depth, .extra = 1
231234
};
232235
data_dims_t output_dims = {
233236
.width = output_width, .height = output_height,
234-
.channels = output_depth, 1
237+
.channels = output_depth, .extra = 1
238+
};
239+
data_dims_t filter_dims = {
240+
.width = filter_width, .height = filter_height,
241+
.channels = 0, .extra = 0
235242
};
236-
data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
237243
conv_params_t conv_params = {
238244
.in_offset = input_offset, .out_offset = output_offset,
239245
.stride = {stride_width, stride_height},

tensorflow/lite/micro/kernels/esp_nn/depthwise_conv.cc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,16 @@ inline void EvalQuantizedPerChannel(TfLiteContext* context, TfLiteNode* node,
114114

115115
data_dims_t input_dims = {
116116
.width = input_width, .height = input_height,
117-
.channels = input_depth, 1
117+
.channels = input_depth, .extra = 1
118118
};
119119
data_dims_t output_dims = {
120120
.width = output_width, .height = output_height,
121-
.channels = output_depth, 1
121+
.channels = output_depth, .extra = 1
122+
};
123+
data_dims_t filter_dims = {
124+
.width = filter_width, .height = filter_height,
125+
.channels = 0, .extra = 0
122126
};
123-
data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
124127
dw_conv_params_t conv_params = {
125128
.in_offset = input_offset, .out_offset = output_offset,
126129
.ch_mult = depth_multiplier,
@@ -254,13 +257,16 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
254257
if (input->type == kTfLiteInt8) {
255258
data_dims_t input_dims = {
256259
.width = input_width, .height = input_height,
257-
.channels = num_input_channels, 1
260+
.channels = num_input_channels, .extra = 1
258261
};
259262
data_dims_t output_dims = {
260263
.width = output_width, .height = output_height,
261-
.channels = output->dims->data[3], 1
264+
.channels = output->dims->data[3], .extra = 1
265+
};
266+
data_dims_t filter_dims = {
267+
.width = filter_width, .height = filter_height,
268+
.channels = 0, .extra = 0
262269
};
263-
data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
264270
dw_conv_params_t conv_params = {
265271
.in_offset = 0, .out_offset = 0,
266272
.ch_mult = params.depth_multiplier,

0 commit comments

Comments
 (0)