From 6ac4f0af6abb3f57d1dc9c9a9999b1d2a5e376c9 Mon Sep 17 00:00:00 2001 From: Guo Sheng Date: Tue, 29 Dec 2020 11:14:06 +0800 Subject: [PATCH] Register op version for coalesce_tensor. (#29940) test=develop test=op_version --- paddle/fluid/operators/coalesce_tensor_op.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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)); -- GitLab