1 /* Copyright 2019 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 #include "tensorflow/lite/python/testdata/test_registerer.h" 16 17 namespace tflite { 18 19 namespace { 20 static int num_test_registerer_calls = 0; 21 } // namespace 22 23 // Dummy registerer function with the correct signature. Ignores the resolver 24 // but increments the num_test_registerer_calls counter by one. The TF_ prefix 25 // is needed to get past the version script in the OSS build. TF_TestRegisterer(tflite::MutableOpResolver * resolver)26extern "C" void TF_TestRegisterer(tflite::MutableOpResolver *resolver) { 27 num_test_registerer_calls++; 28 } 29 30 // Returns the num_test_registerer_calls counter and re-sets it. get_num_test_registerer_calls()31int get_num_test_registerer_calls() { 32 const int result = num_test_registerer_calls; 33 num_test_registerer_calls = 0; 34 return result; 35 } 36 37 } // namespace tflite 38