From 461d2fc0d7ef3ddfc2bcb47561facb43929ecd56 Mon Sep 17 00:00:00 2001 From: tangwei12 Date: Mon, 14 May 2018 15:21:08 +0800 Subject: [PATCH] rename ckpt -> checkpoint --- paddle/fluid/operators/CMakeLists.txt | 4 ++-- ...op_test.cc => che'ck'po'in't_save_op_test.cc} | 6 +++--- .../{ckpt_save_op.cc => checkpoint_save_op.cc} | 16 +++++++++------- 3 files changed, 14 insertions(+), 12 deletions(-) rename paddle/fluid/operators/{ckpt_save_op_test.cc => che'ck'po'in't_save_op_test.cc} (92%) rename paddle/fluid/operators/{ckpt_save_op.cc => checkpoint_save_op.cc} (90%) diff --git a/paddle/fluid/operators/CMakeLists.txt b/paddle/fluid/operators/CMakeLists.txt index 948ce79da..34ec82c29 100644 --- a/paddle/fluid/operators/CMakeLists.txt +++ b/paddle/fluid/operators/CMakeLists.txt @@ -242,7 +242,7 @@ op_library(save_op DEPS lod_tensor) op_library(load_op DEPS lod_tensor) op_library(save_combine_op DEPS lod_tensor) op_library(load_combine_op DEPS lod_tensor) -op_library(ckpt_save_op DEPS lod_tensor) +op_library(checkpoint_save_op DEPS lod_tensor) op_library(concat_op DEPS concat) # FIXME(thuan): Move CSP operators to paddle/fluid/framework/operators/concurrency @@ -278,6 +278,6 @@ cc_test(beam_search_op_test SRCS beam_search_op_test.cc DEPS lod_tensor beam_sea cc_test(strided_memcpy_test SRCS strided_memcpy_test.cc DEPS tensor memory) cc_test(save_load_op_test SRCS save_load_op_test.cc DEPS save_op load_op) cc_test(save_load_combine_op_test SRCS save_load_combine_op_test.cc DEPS save_combine_op load_combine_op) -cc_test(ckpt_save_op_test SRCS ckpt_save_op_test.cc DEPS ckpt_save_op) +cc_test(checkpoint_save_op_test SRCS checkpoint_save_op_test.cc DEPS checkpoint_save_op) nv_test(nccl_op_test SRCS nccl_op_test.cu.cc DEPS nccl_op gpu_info device_context) nv_test(dropout_op_test SRCS dropout_op_test.cc DEPS dropout_op tensor) diff --git a/paddle/fluid/operators/ckpt_save_op_test.cc b/paddle/fluid/operators/che'ck'po'in't_save_op_test.cc similarity index 92% rename from paddle/fluid/operators/ckpt_save_op_test.cc rename to paddle/fluid/operators/che'ck'po'in't_save_op_test.cc index f8616ef53..b49bbd1a5 100644 --- a/paddle/fluid/operators/ckpt_save_op_test.cc +++ b/paddle/fluid/operators/che'ck'po'in't_save_op_test.cc @@ -15,9 +15,9 @@ limitations under the License. */ #include "gtest/gtest.h" #include "paddle/fluid/framework/op_registry.h" -USE_NO_KERNEL_OP(ckpt_save) +USE_NO_KERNEL_OP(checkpoint_save) -TEST(CkptSaveOp, CPU) { +TEST(CheckpointSaveOp, CPU) { paddle::framework::Scope scope; paddle::platform::CPUPlace place; @@ -41,6 +41,6 @@ TEST(CkptSaveOp, CPU) { attrs.insert({"file_path", std::string("tensor.save")}); auto save_op = paddle::framework::OpRegistry::CreateOp( - "ckpt_save", {{"X", {"test_var"}}}, {}, attrs); + "checkpoint_save", {{"X", {"test_var"}}}, {}, attrs); save_op->Run(scope, place); } diff --git a/paddle/fluid/operators/ckpt_save_op.cc b/paddle/fluid/operators/checkpoint_save_op.cc similarity index 90% rename from paddle/fluid/operators/ckpt_save_op.cc rename to paddle/fluid/operators/checkpoint_save_op.cc index 352bd3350..2462ec09d 100644 --- a/paddle/fluid/operators/ckpt_save_op.cc +++ b/paddle/fluid/operators/checkpoint_save_op.cc @@ -57,11 +57,12 @@ static void MkDirRecursively(const char *fullpath) { MkDir(fullpath); } -class CkptSaveOp : public framework::OperatorBase { +class CheckpointSaveOp : public framework::OperatorBase { public: - CkptSaveOp(const std::string &type, const framework::VariableNameMap &inputs, - const framework::VariableNameMap &outputs, - const framework::AttributeMap &attrs) + CheckpointSaveOp(const std::string &type, + const framework::VariableNameMap &inputs, + const framework::VariableNameMap &outputs, + const framework::AttributeMap &attrs) : OperatorBase(type, inputs, outputs, attrs) {} private: @@ -122,9 +123,9 @@ class CkptSaveOp : public framework::OperatorBase { } }; -class CkptSaveOpProtoMaker : public framework::OpProtoAndCheckerMaker { +class CheckpointSaveOpProtoMaker : public framework::OpProtoAndCheckerMaker { public: - CkptSaveOpProtoMaker(OpProto *proto, OpAttrChecker *op_checker) + CheckpointSaveOpProtoMaker(OpProto *proto, OpAttrChecker *op_checker) : OpProtoAndCheckerMaker(proto, op_checker) { AddInput( "X", @@ -155,4 +156,5 @@ to a file on disk. namespace ops = paddle::operators; -REGISTER_OPERATOR(ckpt_save, ops::CkptSaveOp, ops::CkptSaveOpProtoMaker); +REGISTER_OPERATOR(checkpoint_save, ops::CheckpointSaveOp, + ops::CheckpointSaveOpProtoMaker); -- GitLab