Skip to content

Commit

Permalink
Merge branch 'bugfix/explicit_struct_var_init' into 'master'
Browse files Browse the repository at this point in the history
Made all initializer clauses explicit

See merge request app-frameworks/esp-tflite-micro!159
  • Loading branch information
vikramdattu committed Dec 4, 2024
2 parents 776fca8 + 98b03a6 commit a37521a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 12 deletions.
18 changes: 12 additions & 6 deletions tensorflow/lite/micro/kernels/esp_nn/conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,16 @@ static TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
if (input->type == kTfLiteInt8) {
data_dims_t input_dims = {
.width = input_width, .height = input_height,
.channels = input_channels, 1
.channels = input_channels, .extra = 1
};
data_dims_t output_dims = {
.width = output_width, .height = output_height,
.channels = output->dims->data[3], 1
.channels = output->dims->data[3], .extra = 1
};
data_dims_t filter_dims = {
.width = filter_width, .height = filter_height,
.channels = 0, .extra = 0
};
data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
conv_params_t conv_params = {
.in_offset = 0, .out_offset = 0,
.stride = {params.stride_width, params.stride_height},
Expand Down Expand Up @@ -227,13 +230,16 @@ inline void EvalQuantizedPerChannel(

data_dims_t input_dims = {
.width = input_width, .height = input_height,
.channels = input_depth, 1
.channels = input_depth, .extra = 1
};
data_dims_t output_dims = {
.width = output_width, .height = output_height,
.channels = output_depth, 1
.channels = output_depth, .extra = 1
};
data_dims_t filter_dims = {
.width = filter_width, .height = filter_height,
.channels = 0, .extra = 0
};
data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
conv_params_t conv_params = {
.in_offset = input_offset, .out_offset = output_offset,
.stride = {stride_width, stride_height},
Expand Down
18 changes: 12 additions & 6 deletions tensorflow/lite/micro/kernels/esp_nn/depthwise_conv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,16 @@ inline void EvalQuantizedPerChannel(TfLiteContext* context, TfLiteNode* node,

data_dims_t input_dims = {
.width = input_width, .height = input_height,
.channels = input_depth, 1
.channels = input_depth, .extra = 1
};
data_dims_t output_dims = {
.width = output_width, .height = output_height,
.channels = output_depth, 1
.channels = output_depth, .extra = 1
};
data_dims_t filter_dims = {
.width = filter_width, .height = filter_height,
.channels = 0, .extra = 0
};
data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
dw_conv_params_t conv_params = {
.in_offset = input_offset, .out_offset = output_offset,
.ch_mult = depth_multiplier,
Expand Down Expand Up @@ -254,13 +257,16 @@ TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
if (input->type == kTfLiteInt8) {
data_dims_t input_dims = {
.width = input_width, .height = input_height,
.channels = num_input_channels, 1
.channels = num_input_channels, .extra = 1
};
data_dims_t output_dims = {
.width = output_width, .height = output_height,
.channels = output->dims->data[3], 1
.channels = output->dims->data[3], .extra = 1
};
data_dims_t filter_dims = {
.width = filter_width, .height = filter_height,
.channels = 0, .extra = 0
};
data_dims_t filter_dims = {.width = filter_width, .height = filter_height, 0, 0};
dw_conv_params_t conv_params = {
.in_offset = 0, .out_offset = 0,
.ch_mult = params.depth_multiplier,
Expand Down

0 comments on commit a37521a

Please sign in to comment.