Skip to content

Commit

Permalink
Corrected formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
cad-audio committed Dec 13, 2024
1 parent 5b14dd1 commit 0d35313
Showing 1 changed file with 14 additions and 18 deletions.
32 changes: 14 additions & 18 deletions tensorflow/lite/micro/kernels/xtensa/conv_hifi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ TfLiteStatus ConvPrepareHifi(TfLiteContext* context, TfLiteNode* node) {
if ((params->dilation_width_factor == 1) &&
(params->dilation_height_factor == 1)) {
if (input->type == kTfLiteInt8) {
if (input_height == 1 && filter_height == 1 && output_height == 1)
{
if (input_height == 1 && filter_height == 1 && output_height == 1) {
int inp_h, filt_h, filt_w, str_h, pad_h, out_h;
inp_h = input_width;
filt_h = filter_width;
Expand All @@ -104,20 +103,18 @@ TfLiteStatus ConvPrepareHifi(TfLiteContext* context, TfLiteNode* node) {
pad_h = pad_width;
out_h = output_width;
required_scratch = xa_nn_conv2d_std_getsize(
inp_h, input_depth, filt_h, filt_w, str_h,
pad_h, out_h, output_channels, PREC_ASYM8S);
}
else
{
inp_h, input_depth, filt_h, filt_w, str_h, pad_h, out_h,
output_channels, PREC_ASYM8S);
} else {
required_scratch = xa_nn_conv2d_std_getsize(
input_height, input_depth, filter_height, filter_width, stride_height,
pad_height, output_height, output_channels, PREC_ASYM8S);
input_height, input_depth, filter_height, filter_width,
stride_height, pad_height, output_height, output_channels,
PREC_ASYM8S);
}
TF_LITE_ENSURE(context, required_scratch > 0);
}
if (input->type == kTfLiteInt16) {
if (input_height == 1 && filter_height == 1 && output_height == 1)
{
if (input_height == 1 && filter_height == 1 && output_height == 1) {
int inp_h, filt_h, filt_w, str_h, pad_h, out_h;
inp_h = input_width;
filt_h = filter_width;
Expand All @@ -126,14 +123,13 @@ TfLiteStatus ConvPrepareHifi(TfLiteContext* context, TfLiteNode* node) {
pad_h = pad_width;
out_h = output_width;
required_scratch = xa_nn_conv2d_std_getsize(
inp_h, input_depth, filt_h, filt_w, str_h,
pad_h, out_h, output_channels, PREC_SYM16S);
}
else
{
inp_h, input_depth, filt_h, filt_w, str_h, pad_h, out_h,
output_channels, PREC_SYM16S);
} else {
required_scratch = xa_nn_conv2d_std_getsize(
input_height, input_depth, filter_height, filter_width, stride_height,
pad_height, output_height, output_channels, PREC_SYM16S);
input_height, input_depth, filter_height, filter_width,
stride_height, pad_height, output_height, output_channels,
PREC_SYM16S);
}
TF_LITE_ENSURE(context, required_scratch > 0);
}
Expand Down

0 comments on commit 0d35313

Please sign in to comment.