Skip to content

Commit 5e7ea29

Browse files
authored
Add check that output is quantized. (#1830)
BUG=http://b/267818294
1 parent 857f467 commit 5e7ea29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tensorflow/lite/micro/kernels/add_common.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ TfLiteStatus CalculateOpDataAdd(TfLiteContext* context, TfLiteAddParams* params,
3939
data->requires_broadcast = !HaveSameShapes(input1, input2);
4040

4141
if (output->type == kTfLiteInt8 || output->type == kTfLiteInt16) {
42+
TFLITE_CHECK_NE(output->quantization.type, kTfLiteNoQuantization);
43+
4244
// 8bit -> 8bit general quantized path, with general rescalings
4345
data->input1_offset = -input1->params.zero_point;
4446
data->input2_offset = -input2->params.zero_point;

0 commit comments

Comments
 (0)