Skip to content

Commit 7dff0b1

Browse files
committed
fix
1 parent d105800 commit 7dff0b1

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

paddle/fluid/framework/ir/graph_viz_pass.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ using inference::analysis::Dot;
2727
namespace {
2828
const char kGraphVizPath[] = "graph_viz_path";
2929

30-
std::string FormatName(const Node* op) {
31-
if (!op->Op() ||
32-
!op->Op()->HasAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())) {
33-
return op->Name();
30+
std::string FormatName(const Node* node) {
31+
if (!node->IsOp() || !node->Op() ||
32+
!node->Op()->HasAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())) {
33+
return node->Name();
3434
}
3535
const std::string full_scope = boost::get<std::string>(
36-
op->Op()->GetAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName()));
37-
return string::Sprintf("%s%s", full_scope.c_str(), op->Name().c_str());
36+
node->Op()->GetAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName()));
37+
return string::Sprintf("%s%s", full_scope.c_str(), node->Name().c_str());
3838
}
3939
} // namespace
4040

paddle/fluid/framework/ir/node.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Node {
5555
std::string Name() const { return name_; }
5656

5757
VarDesc* Var() {
58-
PADDLE_ENFORCE(type_ == Type::kVariable);
58+
PADDLE_ENFORCE(IsVar());
5959
return var_desc_.get();
6060
}
6161

0 commit comments

Comments
 (0)