forked from tensorflow/tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtensorflow_header_copy.sh
executable file
·73 lines (64 loc) · 2.55 KB
/
tensorflow_header_copy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# There is no tidy set of c++ headers exposing TF's API, or a handy bazel target to build these headers.
#
# Since we need to resolve the full "chain" of dependencies. A quick way of doing this is to compile a header only file
# with the principal c++ includes, say foo.cc, and then look at the compiler's generated dependencies via. foo.D.
#
# Gotta run in the right place (CWD).
if [[ $(git rev-parse --show-toplevel 2>/dev/null) != "$PWD" || "${PWD##*/}" != "tensorflow" ]];
then
echo "Must run from top of tensorflow repo...exiting"
exit -1
fi
# Not populated from a fresh repo, run a target like
# //tensorflow/lite:tensorflowlite first.
FLAT_DIR="./bazel-tensorflow/external/flatbuffers/include"
FLAT_FILES="
flatbuffers/flatbuffers.h \
flatbuffers/base.h \
flatbuffers/stl_emulation.h \
"
TF_FILES="
tensorflow/lite/allocation.h \
tensorflow/lite/c/builtin_op_data.h \
tensorflow/lite/c/c_api_types.h \
tensorflow/lite/c/common.h \
tensorflow/lite/context_util.h \
tensorflow/lite/core/api/error_reporter.h \
tensorflow/lite/core/api/op_resolver.h \
tensorflow/lite/core/api/profiler.h \
tensorflow/lite/core/api/verifier.h \
tensorflow/lite/core/macros.h \
tensorflow/lite/core/subgraph.h \
tensorflow/lite/create_op_resolver.h \
tensorflow/lite/delegates/coreml/coreml_delegate.h \
tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h \
tensorflow/lite/experimental/resource/initialization_status.h \
tensorflow/lite/experimental/resource/resource_base.h \
tensorflow/lite/external_cpu_backend_context.h \
tensorflow/lite/graph_info.h \
tensorflow/lite/internal/signature_def.h \
tensorflow/lite/interpreter.h \
tensorflow/lite/interpreter_builder.h \
tensorflow/lite/kernels/kernel_util.h \
tensorflow/lite/kernels/register.h \
tensorflow/lite/memory_planner.h \
tensorflow/lite/model.h \
tensorflow/lite/model_builder.h \
tensorflow/lite/mutable_op_resolver.h \
tensorflow/lite/op_resolver.h \
tensorflow/lite/portable_type_to_tflitetype.h \
tensorflow/lite/schema/schema_generated.h \
tensorflow/lite/signature_runner.h \
tensorflow/lite/stderr_reporter.h \
tensorflow/lite/string_type.h \
tensorflow/lite/type_to_tflitetype.h \
tensorflow/lite/util.h \
"
head_copy() {
# copy to two locations.
tar -cf - $TF_FILES | (cd $1 && tar -xvf -)
(cd $FLAT_DIR; tar -cf - $FLAT_FILES) | (cd $1 && tar -xvf -)
}
# Two Destinations - we assume here that both tensorflow and software repos have a common root.
head_copy $(realpath ../software/host/Modules/BNI.DLTools/DLTools/Frameworks/TensorFlowLiteC.framework/Headers)
head_copy $(realpath ../software/host/3rdParty/tflite/include)