Prune unused stateless nodes from function bodies.
authorDerek Murray <mrry@google.com>
Mon, 18 Dec 2017 17:16:40 +0000 (09:16 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Mon, 18 Dec 2017 19:56:05 +0000 (11:56 -0800)
commit6548e417f8d26e81d10ee577f8575b1cebc443a8
tree7da9be3e8f0e0319672090f61d43913a59e6b317
parent511181cc1c4e70330ad46f4dbcabc511d1a9af4a
Prune unused stateless nodes from function bodies.

Previously, all nodes in a TensorFlow function would be executed
unconditionally, which led to surprising performance issues (such as
executing a expensive image summary op that was created but unused in
a preprocessing function). We can prune nodes that are not
reverse-reachable from the return values of a function if they are
stateless and are not reverse-reachable from a stateful node.

PiperOrigin-RevId: 179430810
tensorflow/core/BUILD
tensorflow/core/common_runtime/function.cc
tensorflow/core/common_runtime/function_test.cc