未验证 提交 94f03dc2 编写于 作者: C Chen Weihang 提交者: GitHub

support add infershape for no grad op (#40182)

上级 86eafde9
...@@ -286,8 +286,8 @@ struct OpKernelRegistrarFunctorEx<PlaceType, false, I, ...@@ -286,8 +286,8 @@ struct OpKernelRegistrarFunctorEx<PlaceType, false, I,
return 0; \ return 0; \
} }
#define REGISTER_OP_WITHOUT_GRADIENT(op_type, op_class, op_maker_class) \ #define REGISTER_OP_WITHOUT_GRADIENT(op_type, op_class, ...) \
REGISTER_OPERATOR(op_type, op_class, op_maker_class, \ REGISTER_OPERATOR(op_type, op_class, __VA_ARGS__, \
paddle::framework::EmptyGradOpMaker<paddle::framework::OpDesc>, \ paddle::framework::EmptyGradOpMaker<paddle::framework::OpDesc>, \
paddle::framework::EmptyGradOpMaker<paddle::imperative::OpBase>) paddle::framework::EmptyGradOpMaker<paddle::imperative::OpBase>)
......
...@@ -90,9 +90,6 @@ namespace plat = paddle::platform; ...@@ -90,9 +90,6 @@ namespace plat = paddle::platform;
DELCARE_INFER_SHAPE_FUNCTOR(empty, EmptyInferShapeFunctor, DELCARE_INFER_SHAPE_FUNCTOR(empty, EmptyInferShapeFunctor,
PT_INFER_META(phi::CreateInferMeta)); PT_INFER_META(phi::CreateInferMeta));
REGISTER_OP_WITHOUT_GRADIENT(empty, ops::EmptyOp, ops::EmptyOpMaker,
REGISTER_OPERATOR( ops::EmptyOpVarTypeInference,
empty, ops::EmptyOp, ops::EmptyOpMaker, ops::EmptyOpVarTypeInference, EmptyInferShapeFunctor);
paddle::framework::EmptyGradOpMaker<paddle::framework::OpDesc>,
paddle::framework::EmptyGradOpMaker<paddle::imperative::OpBase>,
EmptyInferShapeFunctor);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册