提交 7dff0b11 编写于 作者: X Xin Pan

fix

上级 d1058003
...@@ -27,14 +27,14 @@ using inference::analysis::Dot; ...@@ -27,14 +27,14 @@ using inference::analysis::Dot;
namespace { namespace {
const char kGraphVizPath[] = "graph_viz_path"; const char kGraphVizPath[] = "graph_viz_path";
std::string FormatName(const Node* op) { std::string FormatName(const Node* node) {
if (!op->Op() || if (!node->IsOp() || !node->Op() ||
!op->Op()->HasAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())) { !node->Op()->HasAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())) {
return op->Name(); return node->Name();
} }
const std::string full_scope = boost::get<std::string>( const std::string full_scope = boost::get<std::string>(
op->Op()->GetAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName())); node->Op()->GetAttr(OpProtoAndCheckerMaker::OpNamescopeAttrName()));
return string::Sprintf("%s%s", full_scope.c_str(), op->Name().c_str()); return string::Sprintf("%s%s", full_scope.c_str(), node->Name().c_str());
} }
} // namespace } // namespace
......
...@@ -55,7 +55,7 @@ class Node { ...@@ -55,7 +55,7 @@ class Node {
std::string Name() const { return name_; } std::string Name() const { return name_; }
VarDesc* Var() { VarDesc* Var() {
PADDLE_ENFORCE(type_ == Type::kVariable); PADDLE_ENFORCE(IsVar());
return var_desc_.get(); return var_desc_.get();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册