From 1b6a2a09e8115f163161586413f052f5053fa82d Mon Sep 17 00:00:00 2001 From: lujun Date: Mon, 25 Mar 2019 13:03:13 +0800 Subject: [PATCH] fix mix input type error, test=develop --- paddle/fluid/operators/load_combine_op.cc | 1 + paddle/fluid/operators/load_op.cc | 1 + paddle/fluid/operators/save_combine_op.cc | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/paddle/fluid/operators/load_combine_op.cc b/paddle/fluid/operators/load_combine_op.cc index 2948cf71a..63d3f809f 100644 --- a/paddle/fluid/operators/load_combine_op.cc +++ b/paddle/fluid/operators/load_combine_op.cc @@ -88,4 +88,5 @@ REGISTER_OP_CPU_KERNEL( ops::LoadCombineOpKernel, ops::LoadCombineOpKernel, ops::LoadCombineOpKernel, + ops::LoadCombineOpKernel, ops::LoadCombineOpKernel); diff --git a/paddle/fluid/operators/load_op.cc b/paddle/fluid/operators/load_op.cc index 2d8e6ca85..656728c60 100644 --- a/paddle/fluid/operators/load_op.cc +++ b/paddle/fluid/operators/load_op.cc @@ -64,4 +64,5 @@ REGISTER_OP_CPU_KERNEL( load, ops::LoadOpKernel, ops::LoadOpKernel, ops::LoadOpKernel, + ops::LoadOpKernel, ops::LoadOpKernel); diff --git a/paddle/fluid/operators/save_combine_op.cc b/paddle/fluid/operators/save_combine_op.cc index 62b1e0973..5c4be7a7f 100644 --- a/paddle/fluid/operators/save_combine_op.cc +++ b/paddle/fluid/operators/save_combine_op.cc @@ -24,6 +24,13 @@ class SaveCombineOp : public framework::OperatorWithKernel { using framework::OperatorWithKernel::OperatorWithKernel; void InferShape(framework::InferShapeContext *ctx) const override {} + + protected: + framework::OpKernelType GetExpectedKernelType( + const framework::ExecutionContext &ctx) const override { + return framework::OpKernelType(ctx.MultiInput("X")[0]->type(), + ctx.GetPlace()); + } }; class SaveCombineOpProtoMaker : public framework::OpProtoAndCheckerMaker { @@ -71,4 +78,5 @@ REGISTER_OP_CPU_KERNEL( ops::SaveCombineOpKernel, ops::SaveCombineOpKernel, ops::SaveCombineOpKernel, + ops::SaveCombineOpKernel, ops::SaveCombineOpKernel); -- GitLab