aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph/optimizer_cse.h
blob: 430c97a44964cbf79838da769d92eaa96e5ce623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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_