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_UTIL_H_ 16 #define TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_COREML_BUILDERS_UTIL_H_ 17 18 #include "tensorflow/lite/c/common.h" 19 20 namespace tflite { 21 namespace delegates { 22 namespace coreml { 23 24 // Checks if Binary ops have supported broadcastable shapes. 25 // Core ml arithmetic ops - Add and Mul support broadcasts among 26 // [B, 1, 1, 1], [B, C, 1, 1], [B, 1, H, W], [B, C, H, W]. 27 // other shapes should be rejected. Unless it is a constant tensor of size 1, 28 // which will be added as data. 29 30 bool IsBinaryOpSupported(const TfLiteRegistration* registration, 31 const TfLiteNode* node, TfLiteContext* context); 32 33 } // namespace coreml 34 } // namespace delegates 35 } // namespace tflite 36 #endif // TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_COREML_BUILDERS_UTIL_H_ 37