Daniel Konegen / MNIST_example

Dependencies:   mbed-os

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers micro_mutable_op_resolver.h Source File

micro_mutable_op_resolver.h

00001 /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
00002 
00003 Licensed under the Apache License, Version 2.0 (the "License");
00004 you may not use this file except in compliance with the License.
00005 You may obtain a copy of the License at
00006 
00007     http://www.apache.org/licenses/LICENSE-2.0
00008 
00009 Unless required by applicable law or agreed to in writing, software
00010 distributed under the License is distributed on an "AS IS" BASIS,
00011 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00012 See the License for the specific language governing permissions and
00013 limitations under the License.
00014 ==============================================================================*/
00015 #ifndef TENSORFLOW_LITE_EXPERIMENTAL_MICRO_MICRO_MUTABLE_OP_RESOLVER_H_
00016 #define TENSORFLOW_LITE_EXPERIMENTAL_MICRO_MICRO_MUTABLE_OP_RESOLVER_H_
00017 
00018 #include "tensorflow/lite/core/api/op_resolver.h"
00019 #include "tensorflow/lite/experimental/micro/compatibility.h"
00020 
00021 #ifndef TFLITE_REGISTRATIONS_MAX
00022 #define TFLITE_REGISTRATIONS_MAX (128)
00023 #endif
00024 
00025 namespace tflite {
00026 
00027 class MicroMutableOpResolver : public OpResolver {
00028  public:
00029   const TfLiteRegistration* FindOp(tflite::BuiltinOperator op,
00030                                    int version) const override;
00031   const TfLiteRegistration* FindOp(const char* op, int version) const override;
00032   void AddBuiltin(tflite::BuiltinOperator op, TfLiteRegistration* registration,
00033                   int min_version = 1, int max_version = 1);
00034   void AddCustom(const char* name, TfLiteRegistration* registration,
00035                  int min_version = 1, int max_version = 1);
00036 
00037  private:
00038   TfLiteRegistration registrations_[TFLITE_REGISTRATIONS_MAX];
00039   int registrations_len_ = 0;
00040 
00041   TF_LITE_REMOVE_VIRTUAL_DELETE
00042 };
00043 
00044 }  // namespace tflite
00045 
00046 #endif  // TENSORFLOW_LITE_EXPERIMENTAL_MICRO_MICRO_MUTABLE_OP_RESOLVER_H_