Skip to content

Commit 9128d06

Browse files
committed
Merge branch 'ci/sync_gh_tflite-micro' into 'master'
Sync esp-tflite-micro from github - 833097 See merge request app-frameworks/esp-tflite-micro!157
2 parents bf671df + 9da9a9b commit 9128d06

File tree

3 files changed

+7
-143
lines changed

3 files changed

+7
-143
lines changed

tensorflow/lite/kernels/internal/reference/batch_matmul.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ inline void BatchMatMul(const RuntimeShape& lhs_shape, const int8_t* lhs_data,
111111
const float* scaling_factors,
112112
const int32_t* input_offset, int32_t* row_sums,
113113
const RuntimeShape& output_shape, float* output_data,
114-
bool* compute_row_sums) {
114+
bool* compute_row_sums,
115+
const float* per_channel_scales) {
115116
const RuntimeShape extended_lhs_shape =
116117
RuntimeShape::ExtendedShape(5, lhs_shape);
117118
const RuntimeShape extended_rhs_shape =
@@ -188,7 +189,11 @@ inline void BatchMatMul(const RuntimeShape& lhs_shape, const int8_t* lhs_data,
188189
int32_t row_sum = woff_ptr2[i];
189190
total -= row_sum * batch_offset;
190191
int idx = lhs_rows * j + i;
191-
out_ptr[idx] += batch_scaling_factor * total;
192+
float scale = batch_scaling_factor;
193+
if (per_channel_scales) {
194+
scale *= per_channel_scales[i];
195+
}
196+
out_ptr[idx] += scale * total;
192197
}
193198
}
194199
}

tensorflow/lite/micro/span_test.cc

Lines changed: 0 additions & 59 deletions
This file was deleted.

tensorflow/lite/micro/static_vector_test.cc

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)