aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph/optimizer_cse.h
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/core/graph/optimizer_cse.h')
-rw-r--r--tensorflow/core/graph/optimizer_cse.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/tensorflow/core/graph/optimizer_cse.h b/tensorflow/core/graph/optimizer_cse.h
new file mode 100644
index 0000000000..430c97a449
--- /dev/null
+++ b/tensorflow/core/graph/optimizer_cse.h
@@ -0,0 +1,19 @@
+// An optimization pass that performs common subexpression elimination.
+
+#ifndef TENSORFLOW_GRAPH_OPTIMIZER_CSE_H_
+#define TENSORFLOW_GRAPH_OPTIMIZER_CSE_H_
+
+#include <sys/types.h>
+#include "tensorflow/core/graph/graph.h"
+
+namespace tensorflow {
+
+// Perform common-subexpression elimination on the graph "*g". If
+// "consider_fn" is not nullptr, then only nodes for which
+// consider_fn(node) returns true will be considered for combining
+// during the common subexpression elimination.
+extern void OptimizeCSE(Graph* g, std::function<bool(const Node*)> consider_fn);
+
+} // namespace tensorflow
+
+#endif // TENSORFLOW_GRAPH_OPTIMIZER_CSE_H_