diff --git a/paddle/fluid/operators/controlflow/depend_op.cc b/paddle/fluid/operators/controlflow/depend_op.cc index e66bd33bbf3748ea8c96c84bb7a9cbe977e48b74..a4db1501fd6e9f37670590c96cb5cbdf7a34b9d4 100644 --- a/paddle/fluid/operators/controlflow/depend_op.cc +++ b/paddle/fluid/operators/controlflow/depend_op.cc @@ -59,6 +59,11 @@ class DependOp : public framework::OperatorBase { } }; +class DependOpShapeInference : public framework::InferShapeBase { + public: + void operator()(framework::InferShapeContext *ctx) const override {} +}; + class DependOpProtoMaker : public framework::OpProtoAndCheckerMaker { public: void Make() override { @@ -97,4 +102,5 @@ REGISTER_OPERATOR( paddle::framework::EmptyGradOpMaker, paddle::framework::EmptyGradOpMaker, ops::DependOpProtoMaker, + ops::DependOpShapeInference, ops::DependNoNeedBufferVarsInferer);