You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/examples.rst
-13Lines changed: 0 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,6 @@
1
1
Examples
2
2
========
3
3
4
-
This guide show how to create and run some basic examples that show the functionality of cppflow. The code of these examples is available on the `GitHub repo <https://github.com/serizba/cppflow/tree/cppflow2/examples>`_. To run these examples, just use the provided CMake on each of them (after having installed the TF C API as in :ref:`Installation`):
Copy file name to clipboardExpand all lines: docs/source/installation.rst
+18-9Lines changed: 18 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
Installation
4
4
============
5
5
6
-
One of the advantages of cppflow is that you don't need to compile or install TensorFlow, you just need to download the `TF C API <https://www.tensorflow.org/install/lang_c>`_. As cppflow is a header-only library, once you have the C API, the only thing you need to do is include the cppflow files from your project.
6
+
One of the advantages of cppflow is that you don't need to compile or install TensorFlow, you just need to download the `TF C API <https://www.tensorflow.org/install/lang_c>`_. Cppflow is a header-only library, and thus you can just include the cppflow files in your project.
7
7
8
8
To install the C API in your system you have two options:
9
9
@@ -18,12 +18,8 @@ You can install the C API in a system directory and do not worry about it again.
18
18
19
19
Install the TF C API in custom directory
20
20
----------------------------------------
21
-
.. note::
22
-
The easiest way is to extract the library into your HOME directory, in a folder called ``libtensorflow2``. In this case, you can directly use the CMake files from the examples, which will search for the library in your HOME directory.
23
-
24
-
``mkdir -p ~/libtensorflow2/ && tar -C ~/libtensorflow2/ -xzf (downloaded file)``
25
21
26
-
You can also install the library in a custom directory. In this case, after `downloading it <https://www.tensorflow.org/install/lang_c>`_ and unpacking it you will need to update your PATH or add a hint to your ``CMakeLists.txt`` to find the library.
22
+
You can also install the library in a custom directory. In this case, after `downloading it <https://www.tensorflow.org/install/lang_c>`_ and unpacking it you will need to update your PATH or tell CMake where you placed the library with ``-DCMAKE_PREFIX_PATH=...``.
Or add a hint in ``CMakeLists.txt`` as in the examples:
41
36
42
-
.. code:: cmake
37
+
Install cppflow
38
+
-----------------------------
39
+
40
+
Cppflow is just a header-only library, and thus it does not require to build it. To facilitate the installation, we provide a CMake file that will install the library in your system. To install it, you just have to:
41
+
42
+
.. code:: bash
43
+
44
+
mkdir build
45
+
cd build
46
+
cmake ..
47
+
make -j
48
+
make install
49
+
50
+
.. note::
51
+
If you installed the TF C API in a custom directory, you will need to tell CMake where you placed the library with ``-DCMAKE_PREFIX_PATH=/path/to/mydir/``.
43
52
44
-
find_library(TENSORFLOW_LIB tensorflow HINT /path/to/mydir/lib)
53
+
This will also compile the examples, if you don't want to compile them, you can use ``-DBUILD_EXAMPLES=OFF``.
45
54
46
55
47
56
You are done, now you can proceed to build your :ref:`first example<First example>`.
Copy file name to clipboardExpand all lines: docs/source/quickstart.rst
+26-9Lines changed: 26 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Once you have downloaded the TF C API and cppflow you can start playing with ten
12
12
.. code:: c++
13
13
14
14
#include <iostream>
15
-
#include "cppflow/cppflow.h"
15
+
#include <cppflow/cppflow.h>
16
16
17
17
int main() {
18
18
@@ -26,11 +26,11 @@ Once you have downloaded the TF C API and cppflow you can start playing with ten
26
26
return 0;
27
27
}
28
28
29
-
Easy right?, now you can compile it with the terminal (if you have configured the TF C API as stated in :ref:`Installation`) using the following command:
29
+
Easy right?, now you can compile it with the terminal (if you have configured the TF C API and installed cppflow as stated in :ref:`Installation`) using the following command:
If you installed the TF C API or cppflow in a custom directory, you will need to tell CMake where you placed them ``-DCMAKE_PREFIX_PATH=/path/to/mydir/``.
62
79
63
80
Load a model
64
81
------------
@@ -68,7 +85,7 @@ You can easily run TensorFlow models with cppflow by loading a `saved model <htt
0 commit comments