From 7dff0b11c63e4920540244505c8ecda952154bb0 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Wed, 29 Aug 2018 21:23:06 +0800 Subject: [PATCH] fix --- paddle/fluid/framework/ir/graph_viz_pass.cc | 12 ++++++------ paddle/fluid/framework/ir/node.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/paddle/fluid/framework/ir/graph_viz_pass.cc b/paddle/fluid/framework/ir/graph_viz_pass.cc index 5503c173403..4c7ffe69e93 100644 --- a/paddle/fluid/framework/ir/graph_viz_pass.cc +++ b/paddle/fluid/framework/ir/graph_viz_pass.cc @@ -27,14 +27,14 @@ using inference::analysis::Dot; namespace { const char kGraphVizPath[] = "graph_viz_path"; -std::string FormatName(const Node* op) { - if (!op->Op() || - !op->Op()->HasAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())) { - return op->Name(); +std::string FormatName(const Node* node) { + if (!node->IsOp() || !node->Op() || + !node->Op()->HasAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())) { + return node->Name(); } const std::string full_scope = boost::get( - op->Op()->GetAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())); - return string::Sprintf("%s%s", full_scope.c_str(), op->Name().c_str()); + node->Op()->GetAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())); + return string::Sprintf("%s%s", full_scope.c_str(), node->Name().c_str()); } } // namespace diff --git a/paddle/fluid/framework/ir/node.h b/paddle/fluid/framework/ir/node.h index 545ff3b4a4b..e8f084d20a2 100644 --- a/paddle/fluid/framework/ir/node.h +++ b/paddle/fluid/framework/ir/node.h @@ -55,7 +55,7 @@ class Node { std::string Name() const { return name_; } VarDesc* Var() { - PADDLE_ENFORCE(type_ == Type::kVariable); + PADDLE_ENFORCE(IsVar()); return var_desc_.get(); } -- GitLab