Initialize static TfLiteRegistration objects at compilation time.
After this change, compiled code is up to 100 bytes smaller per object on Aarch64, and removes all runtime code. Expecting similar changes on other platforms. PiperOrigin-RevId: 304261011 Change-Id: I22536a10fd1379e06aea331263bb8deb121a02e1
This commit is contained in:
parent
bfe871e202
commit
e9f0ae16bf
@ -158,16 +158,26 @@ TfLiteStatus Relu6Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace activations
|
} // namespace activations
|
||||||
|
|
||||||
TfLiteRegistration* Register_RELU() {
|
TfLiteRegistration* Register_RELU() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = activations::ReluPrepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = activations::ReluEval;
|
/*prepare=*/activations::ReluPrepare,
|
||||||
|
/*invoke=*/activations::ReluEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_RELU6() {
|
TfLiteRegistration* Register_RELU6() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = activations::Relu6Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = activations::Relu6Eval;
|
/*prepare=*/activations::Relu6Prepare,
|
||||||
|
/*invoke=*/activations::Relu6Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,11 +198,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace add
|
} // namespace add
|
||||||
|
|
||||||
TfLiteRegistration* Register_ADD() {
|
TfLiteRegistration* Register_ADD() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/add::Init,
|
||||||
r.init = add::Init;
|
/*free=*/add::Free,
|
||||||
r.free = add::Free;
|
/*prepare=*/add::Prepare,
|
||||||
r.prepare = add::Prepare;
|
/*invoke=*/add::Eval,
|
||||||
r.invoke = add::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,16 +103,26 @@ TfLiteStatus ArgMaxEval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace arg_min_max
|
} // namespace arg_min_max
|
||||||
|
|
||||||
TfLiteRegistration* Register_ARG_MAX() {
|
TfLiteRegistration* Register_ARG_MAX() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = arg_min_max::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = arg_min_max::ArgMaxEval;
|
/*prepare=*/arg_min_max::Prepare,
|
||||||
|
/*invoke=*/arg_min_max::ArgMaxEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_ARG_MIN() {
|
TfLiteRegistration* Register_ARG_MIN() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = arg_min_max::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = arg_min_max::ArgMinEval;
|
/*prepare=*/arg_min_max::Prepare,
|
||||||
|
/*invoke=*/arg_min_max::ArgMinEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,9 +54,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace ceil
|
} // namespace ceil
|
||||||
|
|
||||||
TfLiteRegistration* Register_CEIL() {
|
TfLiteRegistration* Register_CEIL() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = ceil::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = ceil::Eval;
|
/*prepare=*/ceil::Prepare,
|
||||||
|
/*invoke=*/ceil::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,10 +159,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace circular_buffer
|
} // namespace circular_buffer
|
||||||
|
|
||||||
TfLiteRegistration* Register_CIRCULAR_BUFFER() {
|
TfLiteRegistration* Register_CIRCULAR_BUFFER() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.free = circular_buffer::Free;
|
/*free=*/circular_buffer::Free,
|
||||||
r.prepare = circular_buffer::Prepare;
|
/*prepare=*/circular_buffer::Prepare,
|
||||||
r.invoke = circular_buffer::Eval;
|
/*invoke=*/circular_buffer::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,38 +300,74 @@ TfLiteStatus LessEqualEval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace comparisons
|
} // namespace comparisons
|
||||||
|
|
||||||
TfLiteRegistration* Register_EQUAL() {
|
TfLiteRegistration* Register_EQUAL() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = comparisons::EqualEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/comparisons::EqualEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_NOT_EQUAL() {
|
TfLiteRegistration* Register_NOT_EQUAL() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = comparisons::NotEqualEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/comparisons::NotEqualEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_GREATER() {
|
TfLiteRegistration* Register_GREATER() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = comparisons::GreaterEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/comparisons::GreaterEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_GREATER_EQUAL() {
|
TfLiteRegistration* Register_GREATER_EQUAL() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = comparisons::GreaterEqualEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/comparisons::GreaterEqualEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_LESS() {
|
TfLiteRegistration* Register_LESS() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = comparisons::LessEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/comparisons::LessEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_LESS_EQUAL() {
|
TfLiteRegistration* Register_LESS_EQUAL() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = comparisons::LessEqualEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/comparisons::LessEqualEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
#include "tensorflow/lite/kernels/internal/reference/concatenation.h"
|
#include "tensorflow/lite/kernels/internal/reference/concatenation.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
#include "tensorflow/lite/c/builtin_op_data.h"
|
#include "tensorflow/lite/c/builtin_op_data.h"
|
||||||
@ -176,9 +177,9 @@ void EvalQuantizedUInt8(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
op_params.output_zeropoint = output->params.zero_point;
|
op_params.output_zeropoint = output->params.zero_point;
|
||||||
op_params.output_scale = output->params.scale;
|
op_params.output_scale = output->params.scale;
|
||||||
|
|
||||||
reference_ops::ConcatenationWithScaling(
|
reference_ops::ConcatenationWithScaling(op_params, inputs_shape_ptr,
|
||||||
op_params, inputs_shape_ptr, inputs_data, GetTensorShape(output),
|
inputs_data, GetTensorShape(output),
|
||||||
GetTensorData<uint8>(output));
|
GetTensorData<uint8>(output));
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
||||||
@ -214,9 +215,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace concatenation
|
} // namespace concatenation
|
||||||
|
|
||||||
TfLiteRegistration* Register_CONCATENATION() {
|
TfLiteRegistration* Register_CONCATENATION() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = concatenation::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = concatenation::Eval;
|
/*prepare=*/concatenation::Prepare,
|
||||||
|
/*invoke=*/concatenation::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,9 +271,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace conv
|
} // namespace conv
|
||||||
|
|
||||||
TfLiteRegistration* Register_CONV_2D() {
|
TfLiteRegistration* Register_CONV_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = conv::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = conv::Eval;
|
/*prepare=*/conv::Prepare,
|
||||||
|
/*invoke=*/conv::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -263,11 +263,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace depthwise_conv
|
} // namespace depthwise_conv
|
||||||
|
|
||||||
TfLiteRegistration* Register_DEPTHWISE_CONV_2D() {
|
TfLiteRegistration* Register_DEPTHWISE_CONV_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/depthwise_conv::Init,
|
||||||
r.init = depthwise_conv::Init;
|
/*free=*/depthwise_conv::Free,
|
||||||
r.free = depthwise_conv::Free;
|
/*prepare=*/depthwise_conv::Prepare,
|
||||||
r.prepare = depthwise_conv::Prepare;
|
/*invoke=*/depthwise_conv::Eval,
|
||||||
r.invoke = depthwise_conv::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,9 +119,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace dequantize
|
} // namespace dequantize
|
||||||
|
|
||||||
TfLiteRegistration* Register_DEQUANTIZE() {
|
TfLiteRegistration* Register_DEQUANTIZE() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = dequantize::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = dequantize::Eval;
|
/*prepare=*/dequantize::Prepare,
|
||||||
|
/*invoke=*/dequantize::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,58 +110,114 @@ TfLiteStatus LogicalNotEval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace elementwise
|
} // namespace elementwise
|
||||||
|
|
||||||
TfLiteRegistration* Register_ABS() {
|
TfLiteRegistration* Register_ABS() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = elementwise::GenericPrepare<elementwise::IsNumericSupportedType>;
|
/*init=*/nullptr,
|
||||||
r.invoke = elementwise::AbsEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/
|
||||||
|
elementwise::GenericPrepare<elementwise::IsNumericSupportedType>,
|
||||||
|
/*invoke=*/elementwise::AbsEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_SIN() {
|
TfLiteRegistration* Register_SIN() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = elementwise::GenericPrepare<elementwise::IsNumericSupportedType>;
|
/*init=*/nullptr,
|
||||||
r.invoke = elementwise::SinEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/
|
||||||
|
elementwise::GenericPrepare<elementwise::IsNumericSupportedType>,
|
||||||
|
/*invoke=*/elementwise::SinEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_COS() {
|
TfLiteRegistration* Register_COS() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = elementwise::GenericPrepare<elementwise::IsNumericSupportedType>;
|
/*init=*/nullptr,
|
||||||
r.invoke = elementwise::CosEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/
|
||||||
|
elementwise::GenericPrepare<elementwise::IsNumericSupportedType>,
|
||||||
|
/*invoke=*/elementwise::CosEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_LOG() {
|
TfLiteRegistration* Register_LOG() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = elementwise::GenericPrepare<elementwise::IsNumericSupportedType>;
|
/*init=*/nullptr,
|
||||||
r.invoke = elementwise::LogEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/
|
||||||
|
elementwise::GenericPrepare<elementwise::IsNumericSupportedType>,
|
||||||
|
/*invoke=*/elementwise::LogEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_SQRT() {
|
TfLiteRegistration* Register_SQRT() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = elementwise::GenericPrepare<elementwise::IsNumericSupportedType>;
|
/*init=*/nullptr,
|
||||||
r.invoke = elementwise::SqrtEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/
|
||||||
|
elementwise::GenericPrepare<elementwise::IsNumericSupportedType>,
|
||||||
|
/*invoke=*/elementwise::SqrtEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_RSQRT() {
|
TfLiteRegistration* Register_RSQRT() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = elementwise::GenericPrepare<elementwise::IsNumericSupportedType>;
|
/*init=*/nullptr,
|
||||||
r.invoke = elementwise::RsqrtEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/
|
||||||
|
elementwise::GenericPrepare<elementwise::IsNumericSupportedType>,
|
||||||
|
/*invoke=*/elementwise::RsqrtEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_SQUARE() {
|
TfLiteRegistration* Register_SQUARE() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = elementwise::GenericPrepare<elementwise::IsNumericSupportedType>;
|
/*init=*/nullptr,
|
||||||
r.invoke = elementwise::SquareEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/
|
||||||
|
elementwise::GenericPrepare<elementwise::IsNumericSupportedType>,
|
||||||
|
/*invoke=*/elementwise::SquareEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_LOGICAL_NOT() {
|
TfLiteRegistration* Register_LOGICAL_NOT() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = elementwise::GenericPrepare<elementwise::IsLogicalSupportedType>;
|
/*init=*/nullptr,
|
||||||
r.invoke = elementwise::LogicalNotEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/
|
||||||
|
elementwise::GenericPrepare<elementwise::IsLogicalSupportedType>,
|
||||||
|
/*invoke=*/elementwise::LogicalNotEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,8 +13,9 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "tensorflow/lite/c/common.h"
|
|
||||||
#include "tensorflow/lite/kernels/internal/reference/floor.h"
|
#include "tensorflow/lite/kernels/internal/reference/floor.h"
|
||||||
|
|
||||||
|
#include "tensorflow/lite/c/common.h"
|
||||||
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
|
#include "tensorflow/lite/kernels/internal/tensor_ctypes.h"
|
||||||
#include "tensorflow/lite/kernels/kernel_util.h"
|
#include "tensorflow/lite/kernels/kernel_util.h"
|
||||||
|
|
||||||
@ -37,8 +38,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace floor
|
} // namespace floor
|
||||||
|
|
||||||
TfLiteRegistration* Register_FLOOR() {
|
TfLiteRegistration* Register_FLOOR() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = floor::Eval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/floor::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,11 +221,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace fully_connected
|
} // namespace fully_connected
|
||||||
|
|
||||||
TfLiteRegistration* Register_FULLY_CONNECTED() {
|
TfLiteRegistration* Register_FULLY_CONNECTED() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/fully_connected::Init,
|
||||||
r.init = fully_connected::Init;
|
/*free=*/fully_connected::Free,
|
||||||
r.free = fully_connected::Free;
|
/*prepare=*/fully_connected::Prepare,
|
||||||
r.prepare = fully_connected::Prepare;
|
/*invoke=*/fully_connected::Eval,
|
||||||
r.invoke = fully_connected::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,16 +68,28 @@ TfLiteStatus LogicalAndEval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
TfLiteRegistration* Register_LOGICAL_OR() {
|
TfLiteRegistration* Register_LOGICAL_OR() {
|
||||||
// Init, Free, Prepare, Eval are satisfying the Interface required by
|
// Init, Free, Prepare, Eval are satisfying the Interface required by
|
||||||
// TfLiteRegistration.
|
// TfLiteRegistration.
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = logical::LogicalOrEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/logical::LogicalOrEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_LOGICAL_AND() {
|
TfLiteRegistration* Register_LOGICAL_AND() {
|
||||||
// Init, Free, Prepare, Eval are satisfying the Interface required by
|
// Init, Free, Prepare, Eval are satisfying the Interface required by
|
||||||
// TfLiteRegistration.
|
// TfLiteRegistration.
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = logical::LogicalAndEval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/logical::LogicalAndEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,9 +83,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace activations
|
} // namespace activations
|
||||||
|
|
||||||
TfLiteRegistration* Register_LOGISTIC() {
|
TfLiteRegistration* Register_LOGISTIC() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = activations::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = activations::Eval;
|
/*prepare=*/activations::Prepare,
|
||||||
|
/*invoke=*/activations::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
} // namespace micro
|
} // namespace micro
|
||||||
|
@ -117,16 +117,32 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace maximum_minimum
|
} // namespace maximum_minimum
|
||||||
|
|
||||||
TfLiteRegistration* Register_MAXIMUM() {
|
TfLiteRegistration* Register_MAXIMUM() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.invoke = maximum_minimum::Eval<maximum_minimum::kReference,
|
/*init=*/nullptr,
|
||||||
maximum_minimum::MaximumOp>;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/
|
||||||
|
maximum_minimum::Eval<maximum_minimum::kReference,
|
||||||
|
maximum_minimum::MaximumOp>,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_MINIMUM() {
|
TfLiteRegistration* Register_MINIMUM() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.invoke = maximum_minimum::Eval<maximum_minimum::kReference,
|
/*init=*/nullptr,
|
||||||
maximum_minimum::MinimumOp>;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/
|
||||||
|
maximum_minimum::Eval<maximum_minimum::kReference,
|
||||||
|
maximum_minimum::MinimumOp>,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,9 +163,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace mul
|
} // namespace mul
|
||||||
|
|
||||||
TfLiteRegistration* Register_MUL() {
|
TfLiteRegistration* Register_MUL() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = mul::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = mul::Eval;
|
/*prepare=*/mul::Prepare,
|
||||||
|
/*invoke=*/mul::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,8 +48,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace neg
|
} // namespace neg
|
||||||
|
|
||||||
TfLiteRegistration* Register_NEG() {
|
TfLiteRegistration* Register_NEG() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = neg::Eval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/neg::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,9 +113,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace pack
|
} // namespace pack
|
||||||
|
|
||||||
TfLiteRegistration* Register_PACK() {
|
TfLiteRegistration* Register_PACK() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = pack::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = pack::Eval;
|
/*prepare=*/pack::Prepare,
|
||||||
|
/*invoke=*/pack::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,17 +208,27 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace pad
|
} // namespace pad
|
||||||
|
|
||||||
TfLiteRegistration* Register_PAD() {
|
TfLiteRegistration* Register_PAD() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = pad::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = pad::Eval;
|
/*prepare=*/pad::Prepare,
|
||||||
|
/*invoke=*/pad::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also register Pad as PadV2.
|
// Also register Pad as PadV2.
|
||||||
TfLiteRegistration* Register_PADV2() {
|
TfLiteRegistration* Register_PADV2() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = pad::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = pad::Eval;
|
/*prepare=*/pad::Prepare,
|
||||||
|
/*invoke=*/pad::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,20 +219,26 @@ TfLiteStatus MaxEval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace pooling
|
} // namespace pooling
|
||||||
|
|
||||||
TfLiteRegistration* Register_AVERAGE_POOL_2D() {
|
TfLiteRegistration* Register_AVERAGE_POOL_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/pooling::Init,
|
||||||
r.init = pooling::Init;
|
/*free=*/pooling::Free,
|
||||||
r.free = pooling::Free;
|
/*prepare=*/pooling::Prepare,
|
||||||
r.prepare = pooling::Prepare;
|
/*invoke=*/pooling::AverageEval,
|
||||||
r.invoke = pooling::AverageEval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_MAX_POOL_2D() {
|
TfLiteRegistration* Register_MAX_POOL_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/pooling::Init,
|
||||||
r.init = pooling::Init;
|
/*free=*/pooling::Free,
|
||||||
r.free = pooling::Free;
|
/*prepare=*/pooling::Prepare,
|
||||||
r.prepare = pooling::Prepare;
|
/*invoke=*/pooling::MaxEval,
|
||||||
r.invoke = pooling::MaxEval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,11 +509,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace depthwise_conv
|
} // namespace depthwise_conv
|
||||||
|
|
||||||
TfLiteRegistration* Register_DEPTHWISE_CONV_2D() {
|
TfLiteRegistration* Register_DEPTHWISE_CONV_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/depthwise_conv::Init,
|
||||||
r.init = depthwise_conv::Init;
|
/*free=*/depthwise_conv::Free,
|
||||||
r.free = depthwise_conv::Free;
|
/*prepare=*/depthwise_conv::Prepare,
|
||||||
r.prepare = depthwise_conv::Prepare;
|
/*invoke=*/depthwise_conv::Eval,
|
||||||
r.invoke = depthwise_conv::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,9 +105,14 @@ TfLiteStatus PreluEval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace activations
|
} // namespace activations
|
||||||
|
|
||||||
TfLiteRegistration* Register_PRELU() {
|
TfLiteRegistration* Register_PRELU() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = activations::PreluPrepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = activations::PreluEval;
|
/*prepare=*/activations::PreluPrepare,
|
||||||
|
/*invoke=*/activations::PreluEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,11 +119,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
// AffineQuantize takes scale and zero point and quantizes the float value to
|
// AffineQuantize takes scale and zero point and quantizes the float value to
|
||||||
// quantized output, in int8 or uint8 format.
|
// quantized output, in int8 or uint8 format.
|
||||||
TfLiteRegistration* Register_QUANTIZE() {
|
TfLiteRegistration* Register_QUANTIZE() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/quantize::Init,
|
||||||
r.init = quantize::Init;
|
/*free=*/quantize::Free,
|
||||||
r.free = quantize::Free;
|
/*prepare=*/quantize::Prepare,
|
||||||
r.prepare = quantize::Prepare;
|
/*invoke=*/quantize::Eval,
|
||||||
r.invoke = quantize::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,11 +120,14 @@ TfLiteStatus EvalMean(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace reduce
|
} // namespace reduce
|
||||||
|
|
||||||
TfLiteRegistration* Register_MEAN() {
|
TfLiteRegistration* Register_MEAN() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.init = nullptr;
|
/*free=*/nullptr,
|
||||||
r.free = nullptr;
|
/*prepare=*/reduce::PrepareMeanOrSum,
|
||||||
r.prepare = reduce::PrepareMeanOrSum;
|
/*invoke=*/reduce::EvalMean,
|
||||||
r.invoke = reduce::EvalMean;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
} // namespace micro
|
} // namespace micro
|
||||||
|
@ -90,9 +90,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace reshape
|
} // namespace reshape
|
||||||
|
|
||||||
TfLiteRegistration* Register_RESHAPE() {
|
TfLiteRegistration* Register_RESHAPE() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = reshape::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = reshape::Eval;
|
/*prepare=*/reshape::Prepare,
|
||||||
|
/*invoke=*/reshape::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,9 +54,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace round
|
} // namespace round
|
||||||
|
|
||||||
TfLiteRegistration* Register_ROUND() {
|
TfLiteRegistration* Register_ROUND() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = round::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = round::Eval;
|
/*prepare=*/round::Prepare,
|
||||||
|
/*invoke=*/round::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,9 +116,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace split
|
} // namespace split
|
||||||
|
|
||||||
TfLiteRegistration* Register_SPLIT() {
|
TfLiteRegistration* Register_SPLIT() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = split::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = split::Eval;
|
/*prepare=*/split::Prepare,
|
||||||
|
/*invoke=*/split::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,9 +169,15 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace strided_slice
|
} // namespace strided_slice
|
||||||
|
|
||||||
TfLiteRegistration* Register_STRIDED_SLICE() {
|
TfLiteRegistration* Register_STRIDED_SLICE() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {
|
||||||
r.prepare = strided_slice::Prepare;
|
/*init=*/nullptr,
|
||||||
r.invoke = strided_slice::Eval<strided_slice::kReference>;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/strided_slice::Prepare,
|
||||||
|
/*invoke=*/strided_slice::Eval<strided_slice::kReference>,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,11 +195,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace sub
|
} // namespace sub
|
||||||
|
|
||||||
TfLiteRegistration* Register_SUB() {
|
TfLiteRegistration* Register_SUB() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/sub::Init,
|
||||||
r.init = sub::Init;
|
/*free=*/sub::Free,
|
||||||
r.free = sub::Free;
|
/*prepare=*/sub::Prepare,
|
||||||
r.prepare = sub::Prepare;
|
/*invoke=*/sub::Eval,
|
||||||
r.invoke = sub::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -529,11 +529,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace svdf
|
} // namespace svdf
|
||||||
|
|
||||||
TfLiteRegistration* Register_SVDF() {
|
TfLiteRegistration* Register_SVDF() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/svdf::Init,
|
||||||
r.init = svdf::Init;
|
/*free=*/svdf::Free,
|
||||||
r.free = svdf::Free;
|
/*prepare=*/svdf::Prepare,
|
||||||
r.prepare = svdf::Prepare;
|
/*invoke=*/svdf::Eval,
|
||||||
r.invoke = svdf::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,9 +106,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace unpack
|
} // namespace unpack
|
||||||
|
|
||||||
TfLiteRegistration* Register_UNPACK() {
|
TfLiteRegistration* Register_UNPACK() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = unpack::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = unpack::Eval;
|
/*prepare=*/unpack::Prepare,
|
||||||
|
/*invoke=*/unpack::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,16 +223,26 @@ TfLiteStatus Relu6Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace activations
|
} // namespace activations
|
||||||
|
|
||||||
TfLiteRegistration* Register_RELU() {
|
TfLiteRegistration* Register_RELU() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = activations::ReluPrepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = activations::ReluEval;
|
/*prepare=*/activations::ReluPrepare,
|
||||||
|
/*invoke=*/activations::ReluEval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_RELU6() {
|
TfLiteRegistration* Register_RELU6() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = activations::Relu6Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = activations::Relu6Eval;
|
/*prepare=*/activations::Relu6Prepare,
|
||||||
|
/*invoke=*/activations::Relu6Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -538,9 +538,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace conv
|
} // namespace conv
|
||||||
|
|
||||||
TfLiteRegistration* Register_CONV_2D() {
|
TfLiteRegistration* Register_CONV_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = conv::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = conv::Eval;
|
/*prepare=*/conv::Prepare,
|
||||||
|
/*invoke=*/conv::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,11 +547,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace depthwise_conv
|
} // namespace depthwise_conv
|
||||||
|
|
||||||
TfLiteRegistration* Register_DEPTHWISE_CONV_2D() {
|
TfLiteRegistration* Register_DEPTHWISE_CONV_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/depthwise_conv::Init,
|
||||||
r.init = depthwise_conv::Init;
|
/*free=*/depthwise_conv::Free,
|
||||||
r.free = depthwise_conv::Free;
|
/*prepare=*/depthwise_conv::Prepare,
|
||||||
r.prepare = depthwise_conv::Prepare;
|
/*invoke=*/depthwise_conv::Eval,
|
||||||
r.invoke = depthwise_conv::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,8 +71,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace floor
|
} // namespace floor
|
||||||
|
|
||||||
TfLiteRegistration* Register_FLOOR() {
|
TfLiteRegistration* Register_FLOOR() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.invoke = floor::Eval;
|
/*free=*/nullptr,
|
||||||
|
/*prepare=*/nullptr,
|
||||||
|
/*invoke=*/floor::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,11 +264,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace fully_connected
|
} // namespace fully_connected
|
||||||
|
|
||||||
TfLiteRegistration* Register_FULLY_CONNECTED() {
|
TfLiteRegistration* Register_FULLY_CONNECTED() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/fully_connected::Init,
|
||||||
r.init = fully_connected::Init;
|
/*free=*/fully_connected::Free,
|
||||||
r.free = fully_connected::Free;
|
/*prepare=*/fully_connected::Prepare,
|
||||||
r.prepare = fully_connected::Prepare;
|
/*invoke=*/fully_connected::Eval,
|
||||||
r.invoke = fully_connected::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,9 +115,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace activations
|
} // namespace activations
|
||||||
|
|
||||||
TfLiteRegistration* Register_LOGISTIC() {
|
TfLiteRegistration* Register_LOGISTIC() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/nullptr,
|
||||||
r.prepare = activations::Prepare;
|
/*free=*/nullptr,
|
||||||
r.invoke = activations::Eval;
|
/*prepare=*/activations::Prepare,
|
||||||
|
/*invoke=*/activations::Eval,
|
||||||
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
} // namespace micro
|
} // namespace micro
|
||||||
|
@ -558,20 +558,26 @@ TfLiteStatus MaxEval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace pooling
|
} // namespace pooling
|
||||||
|
|
||||||
TfLiteRegistration* Register_AVERAGE_POOL_2D() {
|
TfLiteRegistration* Register_AVERAGE_POOL_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/pooling::Init,
|
||||||
r.init = pooling::Init;
|
/*free=*/pooling::Free,
|
||||||
r.free = pooling::Free;
|
/*prepare=*/pooling::Prepare,
|
||||||
r.prepare = pooling::Prepare;
|
/*invoke=*/pooling::AverageEval,
|
||||||
r.invoke = pooling::AverageEval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
TfLiteRegistration* Register_MAX_POOL_2D() {
|
TfLiteRegistration* Register_MAX_POOL_2D() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/pooling::Init,
|
||||||
r.init = pooling::Init;
|
/*free=*/pooling::Free,
|
||||||
r.free = pooling::Free;
|
/*prepare=*/pooling::Prepare,
|
||||||
r.prepare = pooling::Prepare;
|
/*invoke=*/pooling::MaxEval,
|
||||||
r.invoke = pooling::MaxEval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,11 +566,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
} // namespace svdf
|
} // namespace svdf
|
||||||
|
|
||||||
TfLiteRegistration* Register_SVDF() {
|
TfLiteRegistration* Register_SVDF() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/svdf::Init,
|
||||||
r.init = svdf::Init;
|
/*free=*/svdf::Free,
|
||||||
r.free = svdf::Free;
|
/*prepare=*/svdf::Prepare,
|
||||||
r.prepare = svdf::Prepare;
|
/*invoke=*/svdf::Eval,
|
||||||
r.invoke = svdf::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,11 +168,14 @@ TfLiteStatus Eval(TfLiteContext* context, TfLiteNode* node) {
|
|||||||
// AffineQuantize takes scale and zero point and quantizes the float value to
|
// AffineQuantize takes scale and zero point and quantizes the float value to
|
||||||
// quantized output, in int8 or uint8 format.
|
// quantized output, in int8 or uint8 format.
|
||||||
TfLiteRegistration* Register_QUANTIZE() {
|
TfLiteRegistration* Register_QUANTIZE() {
|
||||||
static TfLiteRegistration r = {};
|
static TfLiteRegistration r = {/*init=*/quantize::Init,
|
||||||
r.init = quantize::Init;
|
/*free=*/quantize::Free,
|
||||||
r.free = quantize::Free;
|
/*prepare=*/quantize::Prepare,
|
||||||
r.prepare = quantize::Prepare;
|
/*invoke=*/quantize::Eval,
|
||||||
r.invoke = quantize::Eval;
|
/*profiling_string=*/nullptr,
|
||||||
|
/*builtin_code=*/0,
|
||||||
|
/*custom_name=*/nullptr,
|
||||||
|
/*version=*/0};
|
||||||
return &r;
|
return &r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user