Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions paddle/fluid/operators/load_combine_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,5 @@ REGISTER_OP_CPU_KERNEL(
ops::LoadCombineOpKernel<paddle::platform::CPUDeviceContext, float>,
ops::LoadCombineOpKernel<paddle::platform::CPUDeviceContext, double>,
ops::LoadCombineOpKernel<paddle::platform::CPUDeviceContext, int>,
ops::LoadCombineOpKernel<paddle::platform::CPUDeviceContext, int8_t>,
ops::LoadCombineOpKernel<paddle::platform::CPUDeviceContext, int64_t>);
1 change: 1 addition & 0 deletions paddle/fluid/operators/load_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ REGISTER_OP_CPU_KERNEL(
load, ops::LoadOpKernel<paddle::platform::CPUDeviceContext, float>,
ops::LoadOpKernel<paddle::platform::CPUDeviceContext, double>,
ops::LoadOpKernel<paddle::platform::CPUDeviceContext, int>,
ops::LoadOpKernel<paddle::platform::CPUDeviceContext, int8_t>,
ops::LoadOpKernel<paddle::platform::CPUDeviceContext, int64_t>);
23 changes: 19 additions & 4 deletions paddle/fluid/operators/save_combine_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,27 @@ limitations under the License. */
namespace paddle {
namespace operators {

using Tensor = framework::Tensor;

class SaveCombineOp : public framework::OperatorWithKernel {
public:
using framework::OperatorWithKernel::OperatorWithKernel;

void InferShape(framework::InferShapeContext *ctx) const override {}
void InferShape(framework::InferShapeContext* ctx) const override {}

protected:
framework::OpKernelType GetExpectedKernelType(
const framework::ExecutionContext& ctx) const override {
return framework::OpKernelType(framework::proto::VarType::FP32,
ctx.GetPlace());
}
// TODO(lujun): The override here is just to bypass transform
// in operator impl, which is not elegant enough.
framework::OpKernelType GetKernelTypeForVar(
const std::string& var_name, const Tensor& tensor,
const framework::OpKernelType& expected_kernel_type) const override {
return expected_kernel_type;
}
};

class SaveCombineOpProtoMaker : public framework::OpProtoAndCheckerMaker {
Expand Down Expand Up @@ -54,7 +70,7 @@ to a file on disk.
"(string)"
"The \"file_path\" where the LoDTensor variables will be saved.")
.AddCustomChecker(
[](const std::string &path) { return !path.empty(); });
[](const std::string& path) { return !path.empty(); });
}
};

Expand All @@ -70,5 +86,4 @@ REGISTER_OP_CPU_KERNEL(
save_combine,
ops::SaveCombineOpKernel<paddle::platform::CPUDeviceContext, float>,
ops::SaveCombineOpKernel<paddle::platform::CPUDeviceContext, double>,
ops::SaveCombineOpKernel<paddle::platform::CPUDeviceContext, int>,
ops::SaveCombineOpKernel<paddle::platform::CPUDeviceContext, int64_t>);
ops::SaveCombineOpKernel<paddle::platform::CPUDeviceContext, int>);
4 changes: 1 addition & 3 deletions paddle/fluid/operators/save_combine_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ REGISTER_OP_CUDA_KERNEL(
save_combine,
ops::SaveCombineOpKernel<paddle::platform::CUDADeviceContext, float>,
ops::SaveCombineOpKernel<paddle::platform::CUDADeviceContext, double>,
ops::SaveCombineOpKernel<paddle::platform::CUDADeviceContext, int>,
ops::SaveCombineOpKernel<paddle::platform::CUDADeviceContext, int8_t>,
ops::SaveCombineOpKernel<paddle::platform::CUDADeviceContext, int64_t>);
ops::SaveCombineOpKernel<paddle::platform::CUDADeviceContext, int>);