17
0
Files
tensorflow-lite/tensorflow-lite-cmake-find-python.patch
Guillaume GARDET fd26ec17bf Accepting request 979585 from home:bnavigator:branches:science:machinelearning
- tensorflow2 has been removed from Tumbleweed. Provide a separate
  Tensorflow Lite package in version 2.9.1
- Now includes the tflite_runtime python3 package
- Add tensorflow-lite-cmake-find-python.patch

OBS-URL: https://build.opensuse.org/request/show/979585
OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/tensorflow-lite?expand=0&rev=1
2022-05-30 07:42:51 +00:00

29 lines
1.1 KiB
Diff

diff -ur tensorflow-2.9.1.o/tensorflow/lite/CMakeLists.txt tensorflow-2.9.1/tensorflow/lite/CMakeLists.txt
--- tensorflow-2.9.1.o/tensorflow/lite/CMakeLists.txt 2022-05-23 00:28:22.000000000 +0200
+++ tensorflow-2.9.1/tensorflow/lite/CMakeLists.txt 2022-05-28 00:24:30.302080481 +0200
@@ -538,6 +538,9 @@
add_subdirectory(${TFLITE_SOURCE_DIR}/examples/label_image)
# Python interpreter wrapper.
+find_package(Python3 COMPONENTS Interpreter Development NumPy REQUIRED)
+find_package(pybind11 REQUIRED)
+
add_library(_pywrap_tensorflow_interpreter_wrapper SHARED EXCLUDE_FROM_ALL
${TFLITE_SOURCE_DIR}/python/interpreter_wrapper/interpreter_wrapper.cc
${TFLITE_SOURCE_DIR}/python/interpreter_wrapper/interpreter_wrapper_pybind11.cc
@@ -552,11 +555,14 @@
target_include_directories(_pywrap_tensorflow_interpreter_wrapper
PUBLIC
${TFLITE_INCLUDE_DIRS}
+ ${Python3_INCLUDE_DIRS}
+ ${Python3_NumPy_INCLUDE_DIRS}
)
target_link_libraries(_pywrap_tensorflow_interpreter_wrapper
tensorflow-lite
${CMAKE_DL_LIBS}
+ ${Python3_LIBRARIES}
)
target_compile_options(_pywrap_tensorflow_interpreter_wrapper
PUBLIC ${TFLITE_TARGET_PUBLIC_OPTIONS}