Graphs inside a function (Tensorflow) 0018, Jul 10 Code example: def build_graph(): g = tf.Graph() with g.as_default(): a = tf.placeholder(tf.int8, name="a") b = tf.add(a, tf.constant(1, dtype=tf.int8), name="b") return g graph = build_graph() with tf.Session(graph=graph) as sess: feed = {"a:0": 3} print(sess.run("b:0", feed_dict=feed)) Manuel Cuevas Hello, I'm Manuel Cuevas a Software Engineer with background in machine learning and artificial intelligence. Subscribe here to get our latest updates Email Address Please enable JavaScript to view the comments powered by Disqus.