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

Commit 7b1d27f

Browse files
authored
Sync from tflite-micro. (#182)
1 parent 2e88bbc commit 7b1d27f

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ TfLiteRegistration Register_STRIDED_SLICE();
109109
TfLiteRegistration Register_SUB();
110110
TfLiteRegistration Register_SUM();
111111
TfLiteRegistration Register_SVDF();
112+
TfLiteRegistration Register_TANH();
112113
TfLiteRegistration Register_TRANSPOSE();
113114
TfLiteRegistration Register_TRANSPOSE_CONV();
114115
// TODO(b/230666079): resolve conflict with xtensa implementation
@@ -132,8 +133,6 @@ TfLiteRegistration Register_SIN();
132133
TfLiteRegistration Register_SQRT();
133134
TfLiteRegistration Register_SQUARE();
134135
TfLiteRegistration Register_L2_NORMALIZATION();
135-
TfLiteRegistration Register_TANH();
136-
137136
} // namespace micro
138137
} // namespace ops
139138
} // namespace tflite

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright 2020 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.
@@ -28,10 +28,9 @@ limitations under the License.
2828
#include "tensorflow/lite/micro/micro_utils.h"
2929

3030
namespace tflite {
31-
namespace ops {
32-
namespace micro {
33-
namespace activations {
31+
3432
namespace {
33+
3534
constexpr int kInputTensor = 0;
3635
constexpr int kOutputTensor = 0;
3736

@@ -148,8 +147,6 @@ TfLiteStatus TanhPrepare(TfLiteContext* context, TfLiteNode* node) {
148147
return kTfLiteOk;
149148
}
150149

151-
} // namespace
152-
153150
TfLiteStatus TanhEval(TfLiteContext* context, TfLiteNode* node) {
154151
const TfLiteEvalTensor* input =
155152
tflite::micro::GetEvalInput(context, node, kInputTensor);
@@ -193,12 +190,10 @@ TfLiteStatus TanhEval(TfLiteContext* context, TfLiteNode* node) {
193190
}
194191
}
195192

196-
} // namespace activations
193+
} // namespace
197194

198195
TfLiteRegistration Register_TANH() {
199-
return tflite::micro::RegisterOp(
200-
activations::TanhInit, activations::TanhPrepare, activations::TanhEval);
196+
return tflite::micro::RegisterOp(TanhInit, TanhPrepare, TanhEval);
201197
}
202-
} // namespace micro
203-
} // namespace ops
198+
204199
} // 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
@@ -539,8 +539,7 @@ class MicroMutableOpResolver : public MicroOpResolver {
539539
}
540540

541541
TfLiteStatus AddTanh() {
542-
return AddBuiltin(BuiltinOperator_TANH, tflite::ops::micro::Register_TANH(),
543-
ParseTanh);
542+
return AddBuiltin(BuiltinOperator_TANH, Register_TANH(), ParseTanh);
544543
}
545544

546545
TfLiteStatus AddTransposeConv() {

0 commit comments

Comments
 (0)