Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit bd7e861

Browse files
authored
Sync from tflite-micro. (#184)
1 parent 7b1d27f commit bd7e861

File tree

3 files changed

+5
-13
lines changed

3 files changed

+5
-13
lines changed

src/tensorflow/lite/micro/kernels/l2norm.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2017 The TensorFlow Authors. All Rights Reserved.
1+
/* Copyright 2023 The TensorFlow Authors. All Rights Reserved.
22
33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.
@@ -22,9 +22,6 @@ limitations under the License.
2222
#include "tensorflow/lite/micro/micro_log.h"
2323

2424
namespace tflite {
25-
namespace ops {
26-
namespace micro {
27-
namespace l2norm {
2825

2926
namespace {
3027

@@ -37,8 +34,6 @@ enum KernelType {
3734
constexpr int kInputTensor = 0;
3835
constexpr int kOutputTensor = 0;
3936

40-
} // namespace
41-
4237
TfLiteStatus Prepare(TfLiteContext* context, TfLiteNode* node) {
4338
TFLITE_DCHECK(node->user_data != nullptr);
4439
TFLITE_DCHECK(node->builtin_data != nullptr);
@@ -135,14 +130,12 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
135130
return kTfLiteOk;
136131
}
137132

138-
} // namespace l2norm
133+
} // namespace
139134

140135
TfLiteRegistration Register_L2NORM_REF() {
141-
return tflite::micro::RegisterOp(l2norm::Init, l2norm::Prepare, l2norm::Eval);
136+
return tflite::micro::RegisterOp(Init, Prepare, Eval);
142137
}
143138

144139
TfLiteRegistration Register_L2_NORMALIZATION() { return Register_L2NORM_REF(); }
145140

146-
} // namespace micro
147-
} // namespace ops
148141
} // namespace tflite

src/tensorflow/lite/micro/kernels/micro_ops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ TfLiteRegistration Register_GREATER();
6868
TfLiteRegistration Register_GREATER_EQUAL();
6969
TfLiteRegistration Register_HARD_SWISH();
7070
TfLiteRegistration Register_IF();
71+
TfLiteRegistration Register_L2_NORMALIZATION();
7172
TfLiteRegistration Register_L2_POOL_2D();
7273
TfLiteRegistration Register_LEAKY_RELU();
7374
TfLiteRegistration Register_LESS();
@@ -132,7 +133,6 @@ TfLiteRegistration Register_RSQRT();
132133
TfLiteRegistration Register_SIN();
133134
TfLiteRegistration Register_SQRT();
134135
TfLiteRegistration Register_SQUARE();
135-
TfLiteRegistration Register_L2_NORMALIZATION();
136136
} // namespace micro
137137
} // namespace ops
138138
} // namespace tflite

src/tensorflow/lite/micro/micro_mutable_op_resolver.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ class MicroMutableOpResolver : public MicroOpResolver {
300300

301301
TfLiteStatus AddL2Normalization() {
302302
return AddBuiltin(BuiltinOperator_L2_NORMALIZATION,
303-
tflite::ops::micro::Register_L2_NORMALIZATION(),
304-
ParseL2Normalization);
303+
Register_L2_NORMALIZATION(), ParseL2Normalization);
305304
}
306305

307306
TfLiteStatus AddL2Pool2D() {

0 commit comments

Comments
 (0)