Follow comments

revert-4814-Add_sequence_project_op
fengjiayi 7 years ago
parent 097f533bca
commit 803b7b6298

@ -54,6 +54,8 @@ struct OpInfo {
"Operator GradOpMaker has not been registered.");
return grad_op_maker_;
}
const OpAttrChecker* Checker() const { return checker_; }
};
class OpInfoMap {

@ -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);

Loading…
Cancel
Save