tensorflow 0.0.4

Rust language bindings for TensorFlow.
1
2
3
4
5
6
7
8
9
10
11
import tensorflow as tf

w = tf.Variable(0.0, name='w')
b = tf.Variable(0.0, name='b')
x = tf.placeholder(tf.float32, name='x')
y = w * x + b
#tmp = tf.mul(x, 3, name='tmp')
#y = tf.mul(tmp, 2, name='y')
sess = tf.Session()
tf.train.write_graph(sess.graph_def, '/tmp/my-model-txt', 'train.pbtxt', as_text=True)
tf.train.write_graph(sess.graph_def, '/tmp/my-model', 'train.pb', as_text=False)