From f176a9cfa1938b6384fdeb8bf081362f083ee1f3 Mon Sep 17 00:00:00 2001 From: guosheng Date: Mon, 21 May 2018 18:05:13 +0800 Subject: [PATCH] Remove ElementwiseOpInferVarType in elementwise_op to use the default InferVarType to find var recursively --- paddle/fluid/operators/elementwise_op.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/paddle/fluid/operators/elementwise_op.h b/paddle/fluid/operators/elementwise_op.h index d5b57cc2524..d75aa6a6094 100644 --- a/paddle/fluid/operators/elementwise_op.h +++ b/paddle/fluid/operators/elementwise_op.h @@ -42,16 +42,6 @@ class ElementwiseOp : public framework::OperatorWithKernel { } }; -class ElementwiseOpInferVarType : public framework::VarTypeInference { - public: - void operator()(const framework::OpDesc& op_desc, - framework::BlockDesc* block) const override { - auto x_var = op_desc.Input("X")[0]; - auto out_var = op_desc.Output("Out")[0]; - block->Var(out_var)->SetType(block->Var(x_var)->GetType()); - } -}; - class ElementwiseOpMaker : public framework::OpProtoAndCheckerMaker { public: void Make() final { @@ -148,6 +138,5 @@ class ElementwiseOpGrad : public framework::OperatorWithKernel { }; \ REGISTER_OPERATOR(op_type, ::paddle::operators::ElementwiseOp, \ __ElemwiseOp##op_type##Maker__, \ - ::paddle::operators::ElementwiseOpInferVarType, \ ::paddle::framework::DefaultGradOpDescMaker); \ REGISTER_OPERATOR(op_type##_grad, ::paddle::operators::ElementwiseOpGrad) -- GitLab