Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TFLite] Add config option to specify FlatBuffers location #5425

Merged
merged 1 commit into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ set(USE_TFLITE OFF)
# /path/to/tensorflow: tensorflow root path when use tflite library
set(USE_TENSORFLOW_PATH none)

# Required for full builds with TFLite. Not needed for runtime with TFLite.
# /path/to/flatbuffers: flatbuffers root path when using tflite library
set(USE_FLATBUFFERS_PATH none)

# Possible values:
# - OFF: disable tflite support for edgetpu
# - /path/to/edgetpu: use specific path to edgetpu library
Expand Down
7 changes: 5 additions & 2 deletions cmake/modules/contrib/TFLite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

if(NOT USE_TFLITE STREQUAL "OFF")
message(STATUS "Build with contrib.tflite")
if (USE_TENSORFLOW_PATH STREQUAL "none")
if (USE_TENSORFLOW_PATH STREQUAL "none")
set(USE_TENSORFLOW_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tensorflow)
endif()

Expand All @@ -40,5 +40,8 @@ if(NOT USE_TFLITE STREQUAL "OFF")
find_library(TFLITE_CONTRIB_LIB libtensorflow-lite.a ${USE_TFLITE})

list(APPEND TVM_RUNTIME_LINKER_LIBS ${TFLITE_CONTRIB_LIB})
list(APPEND TVM_RUNTIME_LINKER_LIBS rt dl flatbuffers)

if (NOT USE_FLATBUFFERS_PATH STREQUAL "none")
include_directories(${USE_FLATBUFFERS_PATH}/include)
endif()
endif()