Fix a linker error: undefined kMaxSmallSize (#2476) When building with a recent version of xt-clang and -std=c++11, the linker errs on missing definition of a static constexpr class member. In C++11, static class members still had to be defined in a C++11 file and TFLM code is expected to be compatible with C++11. BUG=323856831
diff --git a/tensorflow/lite/kernels/internal/runtime_shape.cc b/tensorflow/lite/kernels/internal/runtime_shape.cc new file mode 100644 index 0000000..dd12278 --- /dev/null +++ b/tensorflow/lite/kernels/internal/runtime_shape.cc
@@ -0,0 +1,23 @@ +/* Copyright 2023 The TensorFlow Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +==============================================================================*/ + +#include "tensorflow/lite/kernels/internal/runtime_shape.h" + +namespace tflite { + +// Defining a constexpr static class member is necessary in C++11 +constexpr int tflite::RuntimeShape::kMaxSmallSize; + +} // namespace tflite