Fix TFLite tests quantization check
PiperOrigin-RevId: 348674459 Change-Id: Ie88c199e7d78b9f1b7a85554adb70cafa196c362
This commit is contained in:
parent
bca32a2148
commit
6119b93daf
@ -231,7 +231,6 @@ cc_library(
|
|||||||
":split",
|
":split",
|
||||||
":test_runner",
|
":test_runner",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"//tensorflow/lite/c:common",
|
|
||||||
"//tensorflow/lite:builtin_op_data",
|
"//tensorflow/lite:builtin_op_data",
|
||||||
"//tensorflow/lite:framework",
|
"//tensorflow/lite:framework",
|
||||||
"//tensorflow/lite:string_util",
|
"//tensorflow/lite:string_util",
|
||||||
@ -240,7 +239,7 @@ cc_library(
|
|||||||
"//tensorflow/lite/kernels:reference_ops",
|
"//tensorflow/lite/kernels:reference_ops",
|
||||||
"//tensorflow/lite/kernels:test_delegate_providers_lib",
|
"//tensorflow/lite/kernels:test_delegate_providers_lib",
|
||||||
"//tensorflow/lite/kernels/hashtable:hashtable_op_kernels",
|
"//tensorflow/lite/kernels/hashtable:hashtable_op_kernels",
|
||||||
"//tensorflow/lite/kernels/parse_example",
|
"//tensorflow/lite/kernels/parse_example:parse_example",
|
||||||
"//tensorflow/lite/kernels/perception:perception_ops",
|
"//tensorflow/lite/kernels/perception:perception_ops",
|
||||||
"//tensorflow/lite/tools/evaluation:utils",
|
"//tensorflow/lite/tools/evaluation:utils",
|
||||||
] + select({
|
] + select({
|
||||||
|
@ -21,7 +21,6 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "absl/strings/escaping.h"
|
#include "absl/strings/escaping.h"
|
||||||
#include "tensorflow/lite/builtin_op_data.h"
|
#include "tensorflow/lite/builtin_op_data.h"
|
||||||
#include "tensorflow/lite/c/common.h"
|
|
||||||
#if !defined(__APPLE__)
|
#if !defined(__APPLE__)
|
||||||
#include "tensorflow/lite/delegates/flex/delegate.h"
|
#include "tensorflow/lite/delegates/flex/delegate.h"
|
||||||
#endif
|
#endif
|
||||||
@ -82,7 +81,7 @@ unique_void_ptr make_type_erased_array(size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool IsQuantized(const TfLiteTensor& tensor) {
|
bool IsQuantized(const TfLiteTensor& tensor) {
|
||||||
if (tensor.quantization.type == kTfLiteNoQuantization) return false;
|
if (tensor.type != kTfLiteInt8 && tensor.type != kTfLiteInt16) return false;
|
||||||
|
|
||||||
if (tensor.quantization.params != nullptr) {
|
if (tensor.quantization.params != nullptr) {
|
||||||
auto* quantization =
|
auto* quantization =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user