Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of headers to use Tensorflow C++ API using libtensorflow_cc.so

Tags:

tensorflow

I want to know what all header files are required in order to use Tensorflow's C++ APIs. Like in case of C APIs, there is just a single header c_api.h which has all the functions, etc. declared, is there any such single header for C++ APIs? I tried searching this, but unable to understand what is required and what is not.

There is a huge list of headers in tensorflow/cc, tensorflow/core and tensorflow/c which are used to build libtensorflow_cc.so and we also ship most of these in the tensorflow's distribution (By TF's distribution I mean TF which is built using bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package). Is that list of headers sufficient in order to use C++ API? or do we need to build any additional target in tensorflow/BUILD?

I've also gone through https://www.tensorflow.org/api_docs/cc/ but can't really make out the exact list of required headers.

In one of the related posts, I found that tensorflow/bazel-genfiles contain the required headers. Please confirm this.

Thanks in advance, Nishidha

like image 626
nishidha panpaliya Avatar asked Mar 20 '17 08:03

nishidha panpaliya


1 Answers

For those who are building TensorFlow v2 C++ for Windows using bazel, kindly use

bazel build --config=opt tensorflow:install_headers

This will generate an include folder with the cc header files in bazel-bin/tensorflow/.

like image 165
pengMiao Avatar answered Nov 12 '22 10:11

pengMiao