diff --git a/paddle/framework/backward_test.cc b/paddle/framework/backward_test.cc index f100c4d05489ac3bd4ceb5f11ae871985f0e5d83..ad8003420dc14538d0dae9a1cb19d6459b154576 100644 --- a/paddle/framework/backward_test.cc +++ b/paddle/framework/backward_test.cc @@ -127,8 +127,8 @@ class FillZeroOpMaker : public OpProtoAndCheckerMaker { public: FillZeroOpMaker(OpProto *proto, OpAttrChecker *op_checker) : OpProtoAndCheckerMaker(proto, op_checker) { - AddInput("x", "x"); - AddOutput("out", "out"); + AddInput("Src", "x"); + AddOutput("Dst", "out"); AddComment(""); } }; @@ -138,7 +138,7 @@ class AddOpMaker : public OpProtoAndCheckerMaker { AddOpMaker(OpProto *proto, OpAttrChecker *op_checker) : OpProtoAndCheckerMaker(proto, op_checker) { AddInput("X", "x").AsDuplicable(); - AddOutput("Y", "y"); + AddOutput("Out", "out"); AddComment(""); } }; diff --git a/paddle/framework/operator.cc b/paddle/framework/operator.cc index 88a872deaadea6a20103ba9e3eaa7a8f099032d7..790cfc4746b1d34da413fa3c29a266f962c6dde6 100644 --- a/paddle/framework/operator.cc +++ b/paddle/framework/operator.cc @@ -151,16 +151,16 @@ std::vector OperatorBase::OutputVars(bool has_intermediate) const { void OperatorBase::CheckAllInputOutputSet() const { auto& info_map = OpInfoMap::Instance(); auto* op_info = info_map.GetNullable(Type()); - if (op_info == nullptr) return; + if (op_info == nullptr || op_info->proto_ == nullptr) return; for (auto& in : op_info->Proto().inputs()) { PADDLE_ENFORCE(inputs_.find(in.name()) != inputs_.end(), - "input %s is not set", in.name()); + "Type %s's input %s is not set", Type(), in.name()); } for (auto& out : op_info->Proto().outputs()) { PADDLE_ENFORCE(outputs_.find(out.name()) != outputs_.end(), - "output %s is not set", out.name()); + "Type %s's output %s is not set", Type(), out.name()); } }