aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/graph
diff options
context:
space:
mode:
authorGravatar AG Ramesh <ag.ramesh@intel.com>2018-07-22 13:49:30 -0700
committerGravatar GitHub <noreply@github.com>2018-07-22 13:49:30 -0700
commitf565cdeef92861eb70b91c36460d0130254f2c91 (patch)
treeb9f2475b6aaedc5bceaf99ab51655ef07570d295 /tensorflow/core/graph
parent99b1fa253c0d46ca95bbdd4890d7879d2b9e8f5f (diff)
Added comments
Diffstat (limited to 'tensorflow/core/graph')
-rw-r--r--tensorflow/core/graph/mkl_layout_pass.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/tensorflow/core/graph/mkl_layout_pass.cc b/tensorflow/core/graph/mkl_layout_pass.cc
index 3c94fa0cbb..836ccae9b7 100644
--- a/tensorflow/core/graph/mkl_layout_pass.cc
+++ b/tensorflow/core/graph/mkl_layout_pass.cc
@@ -2892,6 +2892,7 @@ class MklLayoutRewritePass : public GraphOptimizationPass {
bool do_rewrite = false;
for (const Edge* e : n->in_edges()) {
+ // Rewrite only if there is corresponding LRN, i.e workspace is available
if (e->dst()->type_string() == csinfo_.lrn_grad && e->dst_input() == 2 &&
e->src()->type_string() == mkl_op_registry::GetMklOpName(csinfo_.lrn) &&
e->src_output() == 0) {
@@ -2906,7 +2907,8 @@ class MklLayoutRewritePass : public GraphOptimizationPass {
CHECK_NOTNULL(n);
bool do_rewrite = false;
for (const Edge* e : n->in_edges()) {
- if (e->dst()->type_string() == csinfo_.max_pool_grad && e->dst_input() == 1 &&
+ // Rewrite only if there is corresponding Maxpool, i.e workspace is available
+ if (e->dst()->type_string() == csinfo_.max_pool_grad && e->dst_input() == 1 &&
e->src()->type_string() == mkl_op_registry::GetMklOpName(csinfo_.max_pool) &&
e->src_output() == 0) {
do_rewrite = true;