From af91592f7f586685f8091fa272fdcb97defecae4 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 30 Jun 2023 16:01:56 +0200 Subject: [PATCH] Revert REDUCE_PROD to version 1 c.f. https://github.com/AccelerateHS/accelerate-tensorflow/issues/32 --- tensorflow/lite/kernels/register.cc | 2 +- tensorflow/lite/kernels/register_ref.cc | 2 +- tensorflow/lite/tools/optimize/operator_property.cc | 2 +- tensorflow/lite/tools/versioning/op_version.cc | 8 ++++---- tensorflow/lite/tools/versioning/runtime_version.cc | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tensorflow/lite/kernels/register.cc b/tensorflow/lite/kernels/register.cc index 83da3d319cd9fc..8146888b4eb777 100644 --- a/tensorflow/lite/kernels/register.cc +++ b/tensorflow/lite/kernels/register.cc @@ -224,7 +224,7 @@ BuiltinOpResolver::BuiltinOpResolver() { /* max_version = */ 2); AddBuiltin(BuiltinOperator_REDUCE_PROD, Register_REDUCE_PROD(), /* min_version = */ 1, - /* max_version = */ 2); + /* max_version = */ 1); AddBuiltin(BuiltinOperator_REDUCE_MAX, Register_REDUCE_MAX(), /* min_version = */ 1, /* max_version = */ 3); diff --git a/tensorflow/lite/kernels/register_ref.cc b/tensorflow/lite/kernels/register_ref.cc index 8e6329b7caf292..22089702d73cdb 100644 --- a/tensorflow/lite/kernels/register_ref.cc +++ b/tensorflow/lite/kernels/register_ref.cc @@ -401,7 +401,7 @@ BuiltinRefOpResolver::BuiltinRefOpResolver() { /* max_version = */ 2); AddBuiltin(BuiltinOperator_REDUCE_PROD, Register_REDUCE_PROD_REF(), /* min_version = */ 1, - /* max_version = */ 2); + /* max_version = */ 1); AddBuiltin(BuiltinOperator_REDUCE_MAX, Register_REDUCE_MAX_REF(), /* min_version = */ 1, /* max_version = */ 3); diff --git a/tensorflow/lite/tools/optimize/operator_property.cc b/tensorflow/lite/tools/optimize/operator_property.cc index e9b960536da35c..09a19a167e1fdb 100644 --- a/tensorflow/lite/tools/optimize/operator_property.cc +++ b/tensorflow/lite/tools/optimize/operator_property.cc @@ -1096,7 +1096,7 @@ OperatorProperty GetOperatorProperty(OpVariant op_variant) { case BuiltinOperator_REDUCE_PROD: property.inputs = {{0, {}}}; property.outputs = {{0, {}}}; - property.version = 2; + property.version = 1; break; case BuiltinOperator_REDUCE_MAX: case BuiltinOperator_REDUCE_MIN: diff --git a/tensorflow/lite/tools/versioning/op_version.cc b/tensorflow/lite/tools/versioning/op_version.cc index b11a13354f81cd..87f40f150e24a2 100644 --- a/tensorflow/lite/tools/versioning/op_version.cc +++ b/tensorflow/lite/tools/versioning/op_version.cc @@ -805,10 +805,10 @@ int GetBuiltinOperatorVersion(const OpSignature& op_sig) { return 1; case BuiltinOperator_REDUCE_PROD: - if (op_sig.inputs.at(0).type == kTfLiteInt8 || - op_sig.inputs.at(0).type == kTfLiteInt16) { - return 2; - } + // if (op_sig.inputs.at(0).type == kTfLiteInt8 || + // op_sig.inputs.at(0).type == kTfLiteInt16) { + // return 2; + // } return 1; // The version one of broadcast to op won't be not supported since the diff --git a/tensorflow/lite/tools/versioning/runtime_version.cc b/tensorflow/lite/tools/versioning/runtime_version.cc index d5745c8d7c2fb8..ce9c14b16b5c91 100644 --- a/tensorflow/lite/tools/versioning/runtime_version.cc +++ b/tensorflow/lite/tools/versioning/runtime_version.cc @@ -203,7 +203,7 @@ std::string FindMinimumRuntimeVersionForOp(tflite::BuiltinOperator op_code, {{BuiltinOperator_REDUCE_MIN, 2}, "1.14.0"}, {{BuiltinOperator_REDUCE_MIN, 3}, "2.5.0"}, {{BuiltinOperator_REDUCE_PROD, 1}, "1.11.0"}, - {{BuiltinOperator_REDUCE_PROD, 2}, "2.6.0"}, + // {{BuiltinOperator_REDUCE_PROD, 2}, "2.6.0"}, {{BuiltinOperator_REDUCE_ANY, 1}, "1.11.0"}, {{BuiltinOperator_RELU6, 1}, "1.5.0"}, {{BuiltinOperator_RELU6, 2}, "1.14.0"},