Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tensorflow/lite/micro/kernels/comparisons.cc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@veblush The actual comparison Eval methods should also have INT16 support added. Not all LiteRT comparisons have INT16 support, and it is confusing how some LiteRT comparisons assume (or don't) that the INT16 inputs are not quantized.

Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ TfLiteStatus ComparisonsPrepare(TfLiteContext* context, TfLiteNode* node) {
micro_context->AllocateTempInputTensor(node, kInputTensor2);
TF_LITE_ENSURE(context, input2 != nullptr);

if (input1->type == kTfLiteInt8) {
if (input1->type == kTfLiteInt8 || input1->type == kTfLiteInt16) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@veblush should also have a check if the tensor is in fact quantized (unless the TfLite converter always produces quantized INT16???). I always assumed un-quantized INT16 was just as valid as unquantized INT32. Also add an is_quantized bool to the OpData?

auto input1_offset = -input1->params.zero_point;
auto input2_offset = -input2->params.zero_point;
const int kLeftShift = 8;
Expand Down
Loading