aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
diff options
context:
space:
mode:
authorGravatar Eugene Zhulenev <ezhulenev@google.com>2018-06-05 15:47:59 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-06-05 15:50:34 -0700
commit5c1c4fc8384595e663c970de29fa2374366eb15d (patch)
treed4f74f5a5700b3f688e6b0804f735db285738985 /tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
parent7638924989e42105000048af2af0b6cb8bc4956c (diff)
Move fold-transpose and fold-conjugate optimizations into stages.
PiperOrigin-RevId: 199371452
Diffstat (limited to 'tensorflow/core/grappler/optimizers/arithmetic_optimizer.h')
-rw-r--r--tensorflow/core/grappler/optimizers/arithmetic_optimizer.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h b/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
index 549ea3fde5..f37458eba4 100644
--- a/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
+++ b/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
@@ -54,14 +54,12 @@ class ArithmeticOptimizer : public GraphOptimizer {
// Granular control for arithmetic optimizer stages
struct ArithmeticOptimizerOptions {
- // TODO(ezhulenev): flag do disable TrySimplifyAndReplaceUses in tests.
- // Remove when all optimizers will be migrated to separate stages.
- bool enable_try_simplify_and_replace = true;
-
bool combine_add_to_addn = true;
bool convert_sqrt_div_to_rsqrt_mul = true;
bool dedup_computations = true;
+ bool fold_conjugate_into_transpose = true;
bool fold_multiply_into_conv = true;
+ bool fold_transpose_into_matmul = true;
bool hoist_common_factor_out_of_aggregation = true;
bool hoist_cwise_unary_chains = false;
bool minimize_broadcasts = true;
@@ -86,21 +84,6 @@ class ArithmeticOptimizer : public GraphOptimizer {
}
};
- // Returns true is a node with given name and the optimizer prefix already
- // exists.
- string OptimizedNodeName(const NodeDef& node, StringPiece suffix) const;
- bool OptimizedNodeExists(const NodeDef& node, StringPiece suffix) const;
-
- // Creates a new node in the graph, with name equal to that of node, prefixed
- // with "ArithmeticOptimizer/" and the given suffix. Also updates node_map_,
- // and optionally copies node into the new node if copy_node is true.
- NodeDef* AddNode(const NodeDef& node, StringPiece suffix, bool copy_node);
-
- // Creates a new node in the graph, prefixed with "ArithmeticOptimizer/",
- // updates node_map_, and optionally copies *node_to_copy into the new
- // node, if node_to_copy is not nullptr.
- NodeDef* AddNode(const string& name, const NodeDef* node_to_copy);
-
// Returns true if it is safe to dedup node from the graph.
bool CanDedup(const NodeDef& node) const;