aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <bsteiner@google.com>2018-04-04 16:17:46 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-04 16:22:19 -0700
commitf8acfb01792886274778d9ad7a9d990cbef14141 (patch)
treee089cae1d1813458fad1de0eff700d0d5ff57221 /tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
parente98c13c55e519cb70ede110cd8941f8cb75ab718 (diff)
Fixed handling of control dependencies in the arithmethic optimizer
PiperOrigin-RevId: 191665098
Diffstat (limited to 'tensorflow/core/grappler/optimizers/arithmetic_optimizer.h')
-rw-r--r--tensorflow/core/grappler/optimizers/arithmetic_optimizer.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h b/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
index 63a7b55893..7e81ed0a1f 100644
--- a/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
+++ b/tensorflow/core/grappler/optimizers/arithmetic_optimizer.h
@@ -20,7 +20,6 @@ limitations under the License.
#include "tensorflow/core/grappler/costs/graph_properties.h"
#include "tensorflow/core/grappler/optimizers/graph_optimizer.h"
#include "tensorflow/core/grappler/utils.h"
-#include "tensorflow/core/grappler/utils/frame.h"
#include "tensorflow/core/protobuf/rewriter_config.pb.h"
namespace tensorflow {
@@ -100,13 +99,9 @@ class ArithmeticOptimizer : public GraphOptimizer {
// Dedup redundant nodes in the graph.
void DedupComputations();
- // Fix frame dependencies by adding control dependencies from old_input to
- // nodes in new_nodes_for_control_dep, and update frame_map for all nodes in
- // new_nodes.
- void AddFrameControlDeps(const NodeDef* old_node,
- const std::vector<NodeDef*>& new_nodes,
- const string& source_for_ctrl_dep,
- const std::vector<NodeDef*>& sinks_for_control_dep);
+ // Forward the control dependencies anchored on src_nodes to the target_nodes.
+ void ForwardControlDependencies(NodeDef* target_node,
+ const std::vector<const NodeDef*>& src_nodes);
// Runs peep-hole optimizations on `optimized_graph`, e.g., removing inverse
// transposes.
@@ -135,7 +130,6 @@ class ArithmeticOptimizer : public GraphOptimizer {
bool fetch_nodes_known_ = false;
std::unordered_set<string> nodes_to_preserve_;
std::unique_ptr<NodeMap> node_map_;
- FrameMap frame_map_;
std::unique_ptr<GraphProperties> graph_properties_;
GraphDef* optimized_graph_ = nullptr; // Not owned.
};