Skip to content

Commit

Permalink
Follow comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JiayiFeng committed Oct 6, 2017
1 parent 097f533 commit 803b7b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions paddle/framework/op_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ struct OpInfo {
"Operator GradOpMaker has not been registered.");
return grad_op_maker_;
}

const OpAttrChecker* Checker() const { return checker_; }
};

class OpInfoMap {
Expand Down
4 changes: 2 additions & 2 deletions paddle/framework/op_registry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ std::unique_ptr<OperatorBase> OpRegistry::CreateOp(
const std::string& type, const VariableNameMap& inputs,
const VariableNameMap& outputs, AttributeMap attrs) {
auto& info = OpInfoMap::Instance().Get(type);
if (info.checker_ != nullptr) {
info.checker_->Check(attrs);
if (info.Checker() != nullptr) {
info.Checker()->Check(attrs);
}
auto op = info.Creator()(type, inputs, outputs, attrs);
return std::unique_ptr<OperatorBase>(op);
Expand Down

0 comments on commit 803b7b6

Please sign in to comment.