Skip to content

Commit f176a9c

Browse files
committed
Remove ElementwiseOpInferVarType in elementwise_op to use the default InferVarType to find var recursively
1 parent 35e5563 commit f176a9c

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

paddle/fluid/operators/elementwise_op.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,6 @@ class ElementwiseOp : public framework::OperatorWithKernel {
4242
}
4343
};
4444

45-
class ElementwiseOpInferVarType : public framework::VarTypeInference {
46-
public:
47-
void operator()(const framework::OpDesc& op_desc,
48-
framework::BlockDesc* block) const override {
49-
auto x_var = op_desc.Input("X")[0];
50-
auto out_var = op_desc.Output("Out")[0];
51-
block->Var(out_var)->SetType(block->Var(x_var)->GetType());
52-
}
53-
};
54-
5545
class ElementwiseOpMaker : public framework::OpProtoAndCheckerMaker {
5646
public:
5747
void Make() final {
@@ -148,6 +138,5 @@ class ElementwiseOpGrad : public framework::OperatorWithKernel {
148138
}; \
149139
REGISTER_OPERATOR(op_type, ::paddle::operators::ElementwiseOp, \
150140
__ElemwiseOp##op_type##Maker__, \
151-
::paddle::operators::ElementwiseOpInferVarType, \
152141
::paddle::framework::DefaultGradOpDescMaker<true>); \
153142
REGISTER_OPERATOR(op_type##_grad, ::paddle::operators::ElementwiseOpGrad)

0 commit comments

Comments
 (0)