From be855163184a2828291078d5a8b28f21a0dda4dc Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Thu, 12 Oct 2017 11:59:13 -0700 Subject: [PATCH] Remove attribute check from CreateGradOpDescs() (#4723) * Remove attr_checker from CreateGradOpDescs() * Fix merge error * Fix bug in backward_test.cc --- paddle/framework/backward_test.cc | 1 + paddle/framework/executor_test.cc | 1 + paddle/framework/op_registry.cc | 5 ----- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/paddle/framework/backward_test.cc b/paddle/framework/backward_test.cc index 3b7cbcd9892..8fd8c826187 100644 --- a/paddle/framework/backward_test.cc +++ b/paddle/framework/backward_test.cc @@ -451,6 +451,7 @@ TEST(Backward, default_attribute) { op->SetInput("X", {"x"}); op->SetInput("Y", {"y"}); op->SetOutput("Out", {"out"}); + op->CheckAttrs(); AppendBackward(program, {}); diff --git a/paddle/framework/executor_test.cc b/paddle/framework/executor_test.cc index 137e53d8495..eaa9c9414b6 100644 --- a/paddle/framework/executor_test.cc +++ b/paddle/framework/executor_test.cc @@ -59,6 +59,7 @@ void AddOp(const std::string& type, const VariableNameMap& inputs, op->SetOutput(kv.first, kv.second); } op->SetAttrMap(attrs); + op->CheckAttrs(); } // Tensors in feed value variable will only be in CPUPlace diff --git a/paddle/framework/op_registry.cc b/paddle/framework/op_registry.cc index b118edae174..94f75b0f309 100644 --- a/paddle/framework/op_registry.cc +++ b/paddle/framework/op_registry.cc @@ -62,11 +62,6 @@ std::unique_ptr OpRegistry::CreateOp(const OpDescBind& op_desc) { std::vector> OpRegistry::CreateGradOpDescs( OpDescBind* op_desc) { auto& info = OpInfoMap::Instance().Get(op_desc->Type()); - - if (info.Checker() != nullptr) { - info.Checker()->Check(*op_desc->MutableAttrMap()); - } - return info.grad_op_maker_(*op_desc); } -- GitLab