Fix a floating-point check in the max pool kernel

PiperOrigin-RevId: 301741177
Change-Id: I46de90f4781165733aba6e1a4c84517a2cfed24c
This commit is contained in:
Feng Liu 2020-03-18 22:32:39 -07:00 committed by TensorFlower Gardener
parent c66ecc5c0e
commit 732bce892c

View File

@ -91,9 +91,9 @@ TfLiteStatus GenericPrepare(TfLiteContext* context, TfLiteNode* node) {
if (input->type == kTfLiteUInt8 || input->type == kTfLiteInt8) {
if (pool_type == kAverage || pool_type == kMax) {
TF_LITE_ENSURE_EQ(context, input->params.scale, output->params.scale);
TF_LITE_ENSURE_EQ(context, input->params.zero_point,
output->params.zero_point);
TFLITE_DCHECK_LE(std::abs(input->params.scale - output->params.scale),
1.0e-6);
TFLITE_DCHECK_EQ(input->params.zero_point, output->params.zero_point);
}
if (pool_type == kL2) {
// We currently don't have a quantized implementation of L2Pool