diff --git a/paddle/fluid/operators/coalesce_tensor_op.cc b/paddle/fluid/operators/coalesce_tensor_op.cc index a7c0f12711..628657d4e4 100644 --- a/paddle/fluid/operators/coalesce_tensor_op.cc +++ b/paddle/fluid/operators/coalesce_tensor_op.cc @@ -15,6 +15,7 @@ #include #include #include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/op_version_registry.h" #include "paddle/fluid/framework/operator.h" #include "paddle/fluid/framework/var_type.h" #include "paddle/fluid/operators/math/math_function.h" @@ -277,3 +278,14 @@ REGISTER_OP_CUDA_KERNEL( ops::CoalesceTensorOpKernel, ops::CoalesceTensorOpKernel); #endif + +REGISTER_OP_VERSION(coalesce_tensor) + .AddCheckpoint( + R"ROC( + Upgrade coalesce_tensor: add a new attribute [use_align].)ROC", + paddle::framework::compatible::OpVersionDesc().NewAttr( + "use_align", + "In order to optionally take memory alignment into account when " + "coalescing tensors. The default value is true to be compatible " + "with before.", + true));