<p dir="auto">I attempt to implement naive RBM/DBN through tensorflow's python API.<br>
The functionality is easy to implement if you don't care about computational performance.</p>
<p dir="auto">For now, I've tried many alternatives solutions and find it difficult to implement with high performance since there's no way to cache the intermediate tensor result.</p>
<p dir="auto">While lacking of the ability to cache the intermediate result, there will be too much memory migrate from GPU to RAM or vice versa (say I'm using GPU) if I want to do something through intermediate result.</p>
<p dir="auto">Here's part of my code to illustrate my meaning.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="    import tensorflow as tf
    alpha = .01
    mnist = input_data.read_data_sets(&quot;MNIST_data/&quot;, one_hot=True)
    trX, trY, teX, teY = mnist.train.images, mnist.train.labels,\
        mnist.test.images, mnist.test.labels
    W = tf.Variable(tf.random_normal([784, 100]), name=&quot;weights&quot;)
    hb = tf.Variable(tf.zeros([100]), name=&quot;hbias&quot;)
    vb = tf.Variable(tf.zeros([784]), name=&quot;vbias&quot;)
    v0 = tf.placeholder(&quot;float&quot;, [None, 784])

    h0 = tf.nn.sigmoid(tf.matmul(v0, W) + hb)
    h0 = sample_prob(h0)
    v1 = tf.nn.sigmoid(tf.matmul(h0, tf.transpose(W)) + vb)
    v1 = sample_prob(v1)
    h1 = tf.nn.sigmoid(tf.matmul(v1, W) + hb)

    pg = tf.matmul(tf.transpose(v0), h0)
    ng = tf.matmul(tf.transpose(v1), h1)

    dW = (pg - ng) / tf.to_float(tf.shape(v0)[0])
    dhb = tf.reduce_mean(h0 - h1, 0)
    dvb = tf.reduce_mean(v0 - v1, 0)

    update_W_op = W.assign_add(alpha * dW)
    update_hb_op = hb.assign_add(alpha * dhb)
    update_vb_op = vb.assign_add(alpha * dvb)

    with tf.Session() as sess:
        sess.run(tf.initialize_all_variables())
        for _ in range(10):
            for start, end in zip(
                    range(0, 50000, 100), range(100, 50000, 100)):
                X = trX[start:end]
                # sess.run([dW, dhb, dvb, h1], feed_dict={v0: X})
                # sess.run(h1, feed_dict={v0: X})
                # sess.run(dW)
                # sess.run(dhb)
                # sess.run(dvb)
                # _W = sess.run(update_W_op)
                # _hb = sess.run(update_hb_op)
                # _vb = sess.run(update_vb_op)
                [_W, _hb, _vb] = sess.run([update_W_op, update_hb_op, update_vb_op], feed_dict={v0: X})"><pre class="notranslate">    <span class="pl-k">import</span> <span class="pl-s1">tensorflow</span> <span class="pl-k">as</span> <span class="pl-s1">tf</span>
    <span class="pl-s1">alpha</span> <span class="pl-c1">=</span> <span class="pl-c1">.01</span>
    <span class="pl-s1">mnist</span> <span class="pl-c1">=</span> <span class="pl-s1">input_data</span>.<span class="pl-en">read_data_sets</span>(<span class="pl-s">"MNIST_data/"</span>, <span class="pl-s1">one_hot</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    <span class="pl-s1">trX</span>, <span class="pl-s1">trY</span>, <span class="pl-s1">teX</span>, <span class="pl-s1">teY</span> <span class="pl-c1">=</span> <span class="pl-s1">mnist</span>.<span class="pl-s1">train</span>.<span class="pl-s1">images</span>, <span class="pl-s1">mnist</span>.<span class="pl-s1">train</span>.<span class="pl-s1">labels</span>,\
        <span class="pl-s1">mnist</span>.<span class="pl-s1">test</span>.<span class="pl-s1">images</span>, <span class="pl-s1">mnist</span>.<span class="pl-s1">test</span>.<span class="pl-s1">labels</span>
    <span class="pl-v">W</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Variable</span>(<span class="pl-s1">tf</span>.<span class="pl-en">random_normal</span>([<span class="pl-c1">784</span>, <span class="pl-c1">100</span>]), <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">"weights"</span>)
    <span class="pl-s1">hb</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Variable</span>(<span class="pl-s1">tf</span>.<span class="pl-en">zeros</span>([<span class="pl-c1">100</span>]), <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">"hbias"</span>)
    <span class="pl-s1">vb</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-v">Variable</span>(<span class="pl-s1">tf</span>.<span class="pl-en">zeros</span>([<span class="pl-c1">784</span>]), <span class="pl-s1">name</span><span class="pl-c1">=</span><span class="pl-s">"vbias"</span>)
    <span class="pl-s1">v0</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">placeholder</span>(<span class="pl-s">"float"</span>, [<span class="pl-c1">None</span>, <span class="pl-c1">784</span>])

    <span class="pl-s1">h0</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">nn</span>.<span class="pl-en">sigmoid</span>(<span class="pl-s1">tf</span>.<span class="pl-en">matmul</span>(<span class="pl-s1">v0</span>, <span class="pl-v">W</span>) <span class="pl-c1">+</span> <span class="pl-s1">hb</span>)
    <span class="pl-s1">h0</span> <span class="pl-c1">=</span> <span class="pl-en">sample_prob</span>(<span class="pl-s1">h0</span>)
    <span class="pl-s1">v1</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">nn</span>.<span class="pl-en">sigmoid</span>(<span class="pl-s1">tf</span>.<span class="pl-en">matmul</span>(<span class="pl-s1">h0</span>, <span class="pl-s1">tf</span>.<span class="pl-en">transpose</span>(<span class="pl-v">W</span>)) <span class="pl-c1">+</span> <span class="pl-s1">vb</span>)
    <span class="pl-s1">v1</span> <span class="pl-c1">=</span> <span class="pl-en">sample_prob</span>(<span class="pl-s1">v1</span>)
    <span class="pl-s1">h1</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-s1">nn</span>.<span class="pl-en">sigmoid</span>(<span class="pl-s1">tf</span>.<span class="pl-en">matmul</span>(<span class="pl-s1">v1</span>, <span class="pl-v">W</span>) <span class="pl-c1">+</span> <span class="pl-s1">hb</span>)

    <span class="pl-s1">pg</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">matmul</span>(<span class="pl-s1">tf</span>.<span class="pl-en">transpose</span>(<span class="pl-s1">v0</span>), <span class="pl-s1">h0</span>)
    <span class="pl-s1">ng</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">matmul</span>(<span class="pl-s1">tf</span>.<span class="pl-en">transpose</span>(<span class="pl-s1">v1</span>), <span class="pl-s1">h1</span>)

    <span class="pl-s1">dW</span> <span class="pl-c1">=</span> (<span class="pl-s1">pg</span> <span class="pl-c1">-</span> <span class="pl-s1">ng</span>) <span class="pl-c1">/</span> <span class="pl-s1">tf</span>.<span class="pl-en">to_float</span>(<span class="pl-s1">tf</span>.<span class="pl-en">shape</span>(<span class="pl-s1">v0</span>)[<span class="pl-c1">0</span>])
    <span class="pl-s1">dhb</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reduce_mean</span>(<span class="pl-s1">h0</span> <span class="pl-c1">-</span> <span class="pl-s1">h1</span>, <span class="pl-c1">0</span>)
    <span class="pl-s1">dvb</span> <span class="pl-c1">=</span> <span class="pl-s1">tf</span>.<span class="pl-en">reduce_mean</span>(<span class="pl-s1">v0</span> <span class="pl-c1">-</span> <span class="pl-s1">v1</span>, <span class="pl-c1">0</span>)

    <span class="pl-s1">update_W_op</span> <span class="pl-c1">=</span> <span class="pl-v">W</span>.<span class="pl-en">assign_add</span>(<span class="pl-s1">alpha</span> <span class="pl-c1">*</span> <span class="pl-s1">dW</span>)
    <span class="pl-s1">update_hb_op</span> <span class="pl-c1">=</span> <span class="pl-s1">hb</span>.<span class="pl-en">assign_add</span>(<span class="pl-s1">alpha</span> <span class="pl-c1">*</span> <span class="pl-s1">dhb</span>)
    <span class="pl-s1">update_vb_op</span> <span class="pl-c1">=</span> <span class="pl-s1">vb</span>.<span class="pl-en">assign_add</span>(<span class="pl-s1">alpha</span> <span class="pl-c1">*</span> <span class="pl-s1">dvb</span>)

    <span class="pl-k">with</span> <span class="pl-s1">tf</span>.<span class="pl-v">Session</span>() <span class="pl-k">as</span> <span class="pl-s1">sess</span>:
        <span class="pl-s1">sess</span>.<span class="pl-en">run</span>(<span class="pl-s1">tf</span>.<span class="pl-en">initialize_all_variables</span>())
        <span class="pl-k">for</span> <span class="pl-s1">_</span> <span class="pl-c1">in</span> <span class="pl-en">range</span>(<span class="pl-c1">10</span>):
            <span class="pl-k">for</span> <span class="pl-s1">start</span>, <span class="pl-s1">end</span> <span class="pl-c1">in</span> <span class="pl-en">zip</span>(
                    <span class="pl-en">range</span>(<span class="pl-c1">0</span>, <span class="pl-c1">50000</span>, <span class="pl-c1">100</span>), <span class="pl-en">range</span>(<span class="pl-c1">100</span>, <span class="pl-c1">50000</span>, <span class="pl-c1">100</span>)):
                <span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">trX</span>[<span class="pl-s1">start</span>:<span class="pl-s1">end</span>]
                <span class="pl-c"># sess.run([dW, dhb, dvb, h1], feed_dict={v0: X})</span>
                <span class="pl-c"># sess.run(h1, feed_dict={v0: X})</span>
                <span class="pl-c"># sess.run(dW)</span>
                <span class="pl-c"># sess.run(dhb)</span>
                <span class="pl-c"># sess.run(dvb)</span>
                <span class="pl-c"># _W = sess.run(update_W_op)</span>
                <span class="pl-c"># _hb = sess.run(update_hb_op)</span>
                <span class="pl-c"># _vb = sess.run(update_vb_op)</span>
                [<span class="pl-s1">_W</span>, <span class="pl-s1">_hb</span>, <span class="pl-s1">_vb</span>] <span class="pl-c1">=</span> <span class="pl-s1">sess</span>.<span class="pl-en">run</span>([<span class="pl-s1">update_W_op</span>, <span class="pl-s1">update_hb_op</span>, <span class="pl-s1">update_vb_op</span>], <span class="pl-s1">feed_dict</span><span class="pl-c1">=</span>{<span class="pl-s1">v0</span>: <span class="pl-v">X</span>})</pre></div>
<p dir="auto">This is the most efficient way I could think out. But, there's no way to optimize the progress by calculating <code class="notranslate">[_W, _hb, _vb]</code> with the aid of intermediate result <code class="notranslate">pg, ng, h0, h1, v0, v1</code>. It's obvious that here comes so much duplicated  but useless extra computation.<br>
If feed <code class="notranslate">v0</code> with <code class="notranslate">X</code> once, the follower <code class="notranslate">Tensor</code> need the former <code class="notranslate">Tensor</code>.<br>
<code class="notranslate">h0</code> needs <code class="notranslate">v0</code>, <strong>so needs <code class="notranslate">X</code></strong><br>
<code class="notranslate">v1</code> needs  <code class="notranslate">h0</code>, <strong>so needs <code class="notranslate">X</code></strong><br>
<code class="notranslate">h1</code> needs <code class="notranslate">v1</code>, <strong>so needs <code class="notranslate">X</code></strong><br>
......<br>
<code class="notranslate">update_W_op</code> needs <code class="notranslate">dW</code>, <strong>so needs <code class="notranslate">X</code></strong><br>
<code class="notranslate">update_hb_op</code> needs  <code class="notranslate">dhb</code>, <strong>so needs <code class="notranslate">X</code></strong><br>
<code class="notranslate">update_vb_op</code> needs <code class="notranslate">dvb</code>, <strong>so needs <code class="notranslate">X</code></strong></p>
<p dir="auto">Since there's no way to cache the intermediate result, you can only get one <code class="notranslate">Tensor</code> result for one <code class="notranslate">computation</code>. There's no way to avoid the duplication computation and <code class="notranslate">X</code> memory migration cost.</p>
<p dir="auto">I was wondering if there's a property of <code class="notranslate">Tensor</code> say <code class="notranslate">cached = False</code>, we could set it to <code class="notranslate">True</code> manually. And when intermediate cached result is enough to go on, we need not to feed data in, and just using intermediate cache to compute. If you want to flush the cache, just feed in the new data into the placeholder. But for now, if the graph contains <strong>placeholder</strong> in the path, the data must be feed in specifically.</p>
<p dir="auto">For example, if the cache is enabled.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="h0.cached = True
h1.cached = True
v0.cached = True
v1.cached = True
sess.run(h1, feed_dict={v0: X})
sess.run([update_W_op, update_hb_op, update_vb_op])  # using cache h0,h1,v0,v1 is enough to compute the three update without X fed in."><pre class="notranslate"><span class="pl-s1">h0</span>.<span class="pl-s1">cached</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span>
<span class="pl-s1">h1</span>.<span class="pl-s1">cached</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span>
<span class="pl-s1">v0</span>.<span class="pl-s1">cached</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span>
<span class="pl-s1">v1</span>.<span class="pl-s1">cached</span> <span class="pl-c1">=</span> <span class="pl-c1">True</span>
<span class="pl-s1">sess</span>.<span class="pl-en">run</span>(<span class="pl-s1">h1</span>, <span class="pl-s1">feed_dict</span><span class="pl-c1">=</span>{<span class="pl-s1">v0</span>: <span class="pl-v">X</span>})
<span class="pl-s1">sess</span>.<span class="pl-en">run</span>([<span class="pl-s1">update_W_op</span>, <span class="pl-s1">update_hb_op</span>, <span class="pl-s1">update_vb_op</span>])  <span class="pl-c"># using cache h0,h1,v0,v1 is enough to compute the three update without X fed in.</span></pre></div>
<h3 dir="auto">System information</h3>
<ul dir="auto">
<li><strong>Have I written custom code (as opposed to using a stock example script provided in TensorFlow)</strong>: Yes</li>
<li><strong>OS Platform and Distribution (e.g., Linux Ubuntu 16.04)</strong>: Fedora 27</li>
<li><strong>TensorFlow installed from (source or binary)</strong>: Source</li>
<li><strong>TensorFlow version (use command below)</strong>: v1.8.0-rc1-909-g968addadfd 1.8.0-rc1</li>
<li><strong>Python version</strong>: 3.6m</li>
<li><strong>Bazel version (if compiling from source)</strong>: 0.12.0</li>
<li><strong>GCC/Compiler version (if compiling from source)</strong>: 6.4</li>
<li><strong>CUDA/cuDNN version</strong>: 9.1/7.1</li>
<li><strong>GPU model and memory</strong>: GTX 1080 8GB</li>
<li><strong>Exact command to reproduce</strong>:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="include Makefile.config
TF_INC = `$(PYTHON) -W ignore -c 'import tensorflow as tf; print(tf.sysconfig.get_include())'`
TF_CFLAGS = `$(PYTHON) -W ignore -c 'import tensorflow as tf; print(&quot; &quot;.join(tf.sysconfig.get_compile_flags()))'`
TF_LFLAGS = `$(PYTHON) -W ignore -c 'import tensorflow as tf; print(&quot; &quot;.join(tf.sysconfig.get_link_flags()))'`
CUDA_INC = $(CUDA_HOME)/../
GPUCC     = nvcc -ccbin=$(CXX)
CFLAGS    = -std=c++11 $(TF_CFLAGS) -I. -I$(CUDA_INC) -I$(TF_INC)
GPUCFLAGS = -c
LFLAGS    = $(ODFLAGS) -pthread -fopenmp -shared -fPIC $(TF_LFLAGS)
GPULFLAGS = -x cu -Xcompiler &quot;$(CFLAGS) $(LFLAGS)&quot; --expt-relaxed-constexpr
GPUDEF    = -DGOOGLE_CUDA=1
CGPUFLAGS = -lcuda
SRC       = cart_hex_interpol.cc
GPUSRC    = cart_hex_interpol.cu.cc
SRC_O	  = cart_hex_interpol.o
GPUSRC_O  = cart_hex_interpol.cu.o
LIB       = cart_hex_interpol.so
all: gpu
default: gpu
cpu:
	$(CXX) $(CFLAGS) $(SRC) $(LFLAGS) -o $(LIB)
gpu:
	$(GPUCC) $(GPUDEF) $(CFLAGS) $(GPUCFLAGS) $(GPUSRC) $(GPULFLAGS) -o $(GPUSRC_O)
	$(CXX) $(GPUDEF) $(CFLAGS) $(SRC) $(GPUSRC_O) $(LFLAGS) $(CGPUFLAGS)  -o $(LIB)
clean:
	rm -f $(SRC_O) $(GPUSRC_O) $(LIB)"><pre class="notranslate"><code class="notranslate">include Makefile.config
TF_INC = `$(PYTHON) -W ignore -c 'import tensorflow as tf; print(tf.sysconfig.get_include())'`
TF_CFLAGS = `$(PYTHON) -W ignore -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))'`
TF_LFLAGS = `$(PYTHON) -W ignore -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))'`
CUDA_INC = $(CUDA_HOME)/../
GPUCC     = nvcc -ccbin=$(CXX)
CFLAGS    = -std=c++11 $(TF_CFLAGS) -I. -I$(CUDA_INC) -I$(TF_INC)
GPUCFLAGS = -c
LFLAGS    = $(ODFLAGS) -pthread -fopenmp -shared -fPIC $(TF_LFLAGS)
GPULFLAGS = -x cu -Xcompiler "$(CFLAGS) $(LFLAGS)" --expt-relaxed-constexpr
GPUDEF    = -DGOOGLE_CUDA=1
CGPUFLAGS = -lcuda
SRC       = cart_hex_interpol.cc
GPUSRC    = cart_hex_interpol.cu.cc
SRC_O	  = cart_hex_interpol.o
GPUSRC_O  = cart_hex_interpol.cu.o
LIB       = cart_hex_interpol.so
all: gpu
default: gpu
cpu:
	$(CXX) $(CFLAGS) $(SRC) $(LFLAGS) -o $(LIB)
gpu:
	$(GPUCC) $(GPUDEF) $(CFLAGS) $(GPUCFLAGS) $(GPUSRC) $(GPULFLAGS) -o $(GPUSRC_O)
	$(CXX) $(GPUDEF) $(CFLAGS) $(SRC) $(GPUSRC_O) $(LFLAGS) $(CGPUFLAGS)  -o $(LIB)
clean:
	rm -f $(SRC_O) $(GPUSRC_O) $(LIB)
</code></pre></div>
<h3 dir="auto">Describe the problem</h3>
<p dir="auto">When compiling a custom TensorFlow operator using a Makefile and including CUDA/GPU code, the compilation fails due to missing <code class="notranslate">fatal error: tensorflow/compiler/xla/statusor.h: No such file or directory</code>. The files are missing in <code class="notranslate">/usr/local/lib/python3.6/site-packages/tensorflow/</code> because the headers do not get installed during installation of the wheel package for TensorFlow.<br>
A temporary fix is to copy the headers from source:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="sudo mkdir /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/compiler/
sudo mkdir /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/compiler/xla
sudo cp tensorflow/compiler/xla/*.h /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/compiler/xla/"><pre class="notranslate"><code class="notranslate">sudo mkdir /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/compiler/
sudo mkdir /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/compiler/xla
sudo cp tensorflow/compiler/xla/*.h /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/compiler/xla/
</code></pre></div>
<p dir="auto">This issue was not present in TensorFlow 1.5, but must have been introduced since then. Compiling with or without XLA makes no difference.</p>
<h3 dir="auto">Source code / logs</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="make gpu -j2
nvcc -ccbin=/usr/local/gcc-6.4/bin/g++-6.4 -DGOOGLE_CUDA=1 -std=c++11 `python3 -W ignore -c 'import tensorflow as tf; print(&quot; &quot;.join(tf.sysconfig.get_compile_flags()))'` -I. -I/usr/local/cuda/../ -I`python3 -W ignore -c 'import tensorflow as tf; print(tf.sysconfig.get_include())'` -c cart_hex_interpol.cu.cc -x cu -Xcompiler &quot;-std=c++11 `python3 -W ignore -c 'import tensorflow as tf; print(&quot; &quot;.join(tf.sysconfig.get_compile_flags()))'` -I. -I/usr/local/cuda/../ -I`python3 -W ignore -c 'import tensorflow as tf; print(tf.sysconfig.get_include())'` -O3 -pthread -fopenmp -shared -fPIC `python3 -W ignore -c 'import tensorflow as tf; print(&quot; &quot;.join(tf.sysconfig.get_link_flags()))'`&quot; --expt-relaxed-constexpr -o cart_hex_interpol.cu.o
In file included from /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/stream_executor/dso_loader.h:26:0,
                 from /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/platform/stream_executor.h:26,
                 from /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/util/cuda_launch_config.h:27,
                 from /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h:22,
                 from cart_hex_interpol.cu.cc:5:
/usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/stream_executor/lib/statusor.h:21:46: fatal error: tensorflow/compiler/xla/statusor.h: No such file or directory
 #include &quot;tensorflow/compiler/xla/statusor.h&quot;
"><pre class="notranslate"><code class="notranslate">make gpu -j2
nvcc -ccbin=/usr/local/gcc-6.4/bin/g++-6.4 -DGOOGLE_CUDA=1 -std=c++11 `python3 -W ignore -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))'` -I. -I/usr/local/cuda/../ -I`python3 -W ignore -c 'import tensorflow as tf; print(tf.sysconfig.get_include())'` -c cart_hex_interpol.cu.cc -x cu -Xcompiler "-std=c++11 `python3 -W ignore -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))'` -I. -I/usr/local/cuda/../ -I`python3 -W ignore -c 'import tensorflow as tf; print(tf.sysconfig.get_include())'` -O3 -pthread -fopenmp -shared -fPIC `python3 -W ignore -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))'`" --expt-relaxed-constexpr -o cart_hex_interpol.cu.o
In file included from /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/stream_executor/dso_loader.h:26:0,
                 from /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/platform/stream_executor.h:26,
                 from /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/util/cuda_launch_config.h:27,
                 from /usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/core/util/cuda_kernel_helper.h:22,
                 from cart_hex_interpol.cu.cc:5:
/usr/local/lib/python3.6/site-packages/tensorflow/include/tensorflow/stream_executor/lib/statusor.h:21:46: fatal error: tensorflow/compiler/xla/statusor.h: No such file or directory
 #include "tensorflow/compiler/xla/statusor.h"

</code></pre></div>