• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7     http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 #ifndef TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_COREML_BUILDERS_DUMMY_OP_BUILDER_H_
16 #define TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_COREML_BUILDERS_DUMMY_OP_BUILDER_H_
17 
18 #include "tensorflow/lite/builtin_ops.h"
19 #include "tensorflow/lite/c/builtin_op_data.h"
20 #include "tensorflow/lite/c/common.h"
21 #include "tensorflow/lite/delegates/coreml/builders/op_builder.h"
22 
23 namespace tflite {
24 namespace delegates {
25 namespace coreml {
26 
27 // Dummy Opbuilder for nodes that are claimed but not used. ex) FP16 dequantize
28 class DummyOpBuilder : public OpBuilder {
29  public:
DummyOpBuilder(GraphBuilder * graph_builder)30   explicit DummyOpBuilder(GraphBuilder* graph_builder)
31       : OpBuilder(graph_builder) {}
32   CoreML::Specification::NeuralNetworkLayer* Build() override;
33   TfLiteStatus PopulateSubgraph(TfLiteContext* context) override;
34   const std::string& DebugName() override;
35 
36   TfLiteStatus RegisterInputs(const TfLiteIntArray* inputs,
37                               TfLiteContext* context) override;
38 
39   TfLiteStatus RegisterOutputs(const TfLiteIntArray* outputs,
40                                TfLiteContext* context) override;
41 };
42 
43 }  // namespace coreml
44 }  // namespace delegates
45 }  // namespace tflite
46 
47 #endif  // THIRD_PARTY_TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_COREML_BUILDERS_DUMMY_OP_BUILDER_H_
48