Flatten kernel namespace: ROUND (#2113) @tensorflow/micro Flatten namespace for kernel operator ROUND Update unit tests namespace usage Update MicroOpResolver namespace usage bug=fixes #2112
diff --git a/tensorflow/lite/micro/kernels/micro_ops.h b/tensorflow/lite/micro/kernels/micro_ops.h index 2dd5474..0a2391b 100644 --- a/tensorflow/lite/micro/kernels/micro_ops.h +++ b/tensorflow/lite/micro/kernels/micro_ops.h
@@ -103,6 +103,7 @@ TFLMRegistration Register_RESHAPE(); TFLMRegistration Register_RESIZE_BILINEAR(); TFLMRegistration Register_RESIZE_NEAREST_NEIGHBOR(); +TFLMRegistration Register_ROUND(); TFLMRegistration Register_RSQRT(); TFLMRegistration Register_SELECT_V2(); TFLMRegistration Register_SHAPE(); @@ -137,11 +138,6 @@ TFLMRegistration* Register_WINDOW(); } // namespace tflm_signal -namespace ops { -namespace micro { -TFLMRegistration Register_ROUND(); -} // namespace micro -} // namespace ops } // namespace tflite #endif // TENSORFLOW_LITE_MICRO_KERNELS_MICRO_OPS_H_
diff --git a/tensorflow/lite/micro/kernels/round.cc b/tensorflow/lite/micro/kernels/round.cc index 7a9458b..a42349e 100644 --- a/tensorflow/lite/micro/kernels/round.cc +++ b/tensorflow/lite/micro/kernels/round.cc
@@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2023 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,9 +21,7 @@ #include "tensorflow/lite/micro/kernels/kernel_util.h" namespace tflite { -namespace ops { -namespace micro { -namespace round { +namespace { constexpr int kInputTensor = 0; constexpr int kOutputTensor = 0; @@ -65,12 +63,10 @@ return kTfLiteOk; } -} // namespace round +} // namespace TFLMRegistration Register_ROUND() { - return tflite::micro::RegisterOp(nullptr, round::Prepare, round::Eval); + return tflite::micro::RegisterOp(nullptr, Prepare, Eval); } -} // namespace micro -} // namespace ops } // namespace tflite
diff --git a/tensorflow/lite/micro/kernels/round_test.cc b/tensorflow/lite/micro/kernels/round_test.cc index 1edb609..fa09a9f 100644 --- a/tensorflow/lite/micro/kernels/round_test.cc +++ b/tensorflow/lite/micro/kernels/round_test.cc
@@ -1,4 +1,4 @@ -/* Copyright 2018 The TensorFlow Authors. All Rights Reserved. +/* Copyright 2023 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ int outputs_array_data[] = {1, 1}; TfLiteIntArray* outputs_array = IntArrayFromInts(outputs_array_data); - const TFLMRegistration registration = tflite::ops::micro::Register_ROUND(); + const TFLMRegistration registration = tflite::Register_ROUND(); micro::KernelRunner runner(registration, tensors, tensors_size, inputs_array, outputs_array, nullptr);
diff --git a/tensorflow/lite/micro/micro_mutable_op_resolver.h b/tensorflow/lite/micro/micro_mutable_op_resolver.h index 690aaa6..949ce26 100644 --- a/tensorflow/lite/micro/micro_mutable_op_resolver.h +++ b/tensorflow/lite/micro/micro_mutable_op_resolver.h
@@ -456,8 +456,7 @@ } TfLiteStatus AddRound() { - return AddBuiltin(BuiltinOperator_ROUND, - tflite::ops::micro::Register_ROUND(), ParseRound); + return AddBuiltin(BuiltinOperator_ROUND, Register_ROUND(), ParseRound); } TfLiteStatus AddRsqrt() {