title: Prune computation graph in tensorflow
body: <p>A computation graph in tensorflow has some node <code>input</code> and some node <code>output</code>. <code>input</code> represents the input tensor to a neural network, <code>output</code> its prediction. Some other subgraph feeds to <code>input</code>, some losses (and other computations) follow on <code>output</code>. After training is finished, I would like to keep only the (forward) subgraph between <code>input</code> and <code>output</code>. Is it possible to remove all other ops? <a href="https://stackoverflow.com/questions/37103002/deleting-all-but-a-few-nodes-in-tensorflow-graph">Deleting all but a few nodes in TensorFlow graph</a> indicates that per-se this is not possible. Maybe through the de-tour of exporting stuff using <code>tf.train.export_meta_graph</code>?</p>