TUTORIAL #9 - LOADING A TENSORFLOW GRAPH WITH THE C++ API

287 views
Skip to first unread message

TensorFlow

unread,
Nov 21, 2015, 2:55:42 AM11/21/15
to TensorFlow End Users - GETTING STARTED, TUTORIALS & HOW-TO'S
TUTORIAL #9

* TUTORIAL TITLE *
LOADING A TENSORFLOW GRAPH WITH THE C++ API 

* TUTORIAL DESCRIPTION *
The current documentation around loading a graph with C++ is pretty sparse.
In the TensorFlow repo there are more involved examples, such as building a graph in C++.
However, the C++ API for constructing graphs is not as complete as the Python API.
Many features (including automatic gradient computation) are not available from C++ yet.
Another example in the repo demonstrates defining your own operations but most users will never need this.

* TUTORIAL SYLLABUS *
1 - Downloading and installing Bazel.
2 - Creating the graph
3 - Creating a simple binary or shared library
4 - Compile & Run

* TRY IT *
https://medium.com/@jimfleming/loading-a-tensorflow-graph-with-the-c-api-4caaff88463f#.sq0tq7xdg

Alperen AYDIN

unread,
Aug 17, 2016, 3:53:21 PM8/17/16
to TensorFlow End Users - GETTING STARTED, TUTORIALS & HOW-TO'S
Hello. I have been having problems with a similar problem. Rather having scalars as inputs, I wish to have a 4D Tensor.

So I generate my 4D Tensor with Eigen (let's call it T). I also create a TF Tensor with the same shape (called x). Then I try to use the Tensor::matrix() or the Tensor::tensor() function to put T in x like so:

> x.matrix<float>()() = T

Now based on the documentation I thought that this would work but it does. What is the proper way to do this?

Glen Mabey

unread,
Dec 28, 2017, 8:04:53 PM12/28/17
to TensorFlow End Users - GETTING STARTED, TUTORIALS & HOW-TO'S
Reply all
Reply to author
Forward
0 new messages