aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/grappler/grappler_item_builder.cc
diff options
context:
space:
mode:
authorGravatar Max Galkin <maxgalkin@google.com>2017-10-20 10:43:56 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-10-20 10:47:52 -0700
commitc91dadb3737395de6b09f4f52596d7ce202eff8f (patch)
tree2b5a014d93e473759f408a20b103b19c951e9f35 /tensorflow/core/grappler/grappler_item_builder.cc
parentf86588ce8fb38ab3a6afc21eb08d2a2097b56adc (diff)
Minor change: extra logging to help understand the effects of OptimizeGraph and PruneGraph calls.
PiperOrigin-RevId: 172902338
Diffstat (limited to 'tensorflow/core/grappler/grappler_item_builder.cc')
-rw-r--r--tensorflow/core/grappler/grappler_item_builder.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/tensorflow/core/grappler/grappler_item_builder.cc b/tensorflow/core/grappler/grappler_item_builder.cc
index 54d60cd7aa..3f6183b6f1 100644
--- a/tensorflow/core/grappler/grappler_item_builder.cc
+++ b/tensorflow/core/grappler/grappler_item_builder.cc
@@ -450,12 +450,16 @@ std::unique_ptr<GrapplerItem> GrapplerItemFromMetaGraphDef(
}
// Optimize the graph (function inlining, l1 optimizations, etc).
+ VLOG(1) << "Number of nodes in graph before OptimizeGraph: "
+ << new_item->graph.node_size();
Status optimize_status =
OptimizeGraph(new_item->graph, &new_item->graph, cfg);
if (!optimize_status.ok()) {
LOG(ERROR) << "Graph preprocessing failed: " << optimize_status;
return nullptr;
}
+ VLOG(1) << "Number of nodes in graph after OptimizeGraph: "
+ << new_item->graph.node_size();
if (cfg.prune_graph) {
VLOG(1) << "Pruning graph...";
@@ -464,7 +468,8 @@ std::unique_ptr<GrapplerItem> GrapplerItemFromMetaGraphDef(
LOG(ERROR) << "Pruning failed: " << status.error_message();
return nullptr;
}
- VLOG(1) << "Pruning ran succesfully.";
+ VLOG(1) << "Number of nodes in graph after pruning: "
+ << new_item->graph.node_size();
}
// Validate feed, fetch and init nodes