diff --git a/paddle/fluid/operators/p_norm_op.cc b/paddle/fluid/operators/p_norm_op.cc index 426a059c2a..7576950561 100644 --- a/paddle/fluid/operators/p_norm_op.cc +++ b/paddle/fluid/operators/p_norm_op.cc @@ -16,6 +16,7 @@ limitations under the License. */ #include #include #include +#include "paddle/fluid/framework/op_version_registry.h" namespace paddle { namespace operators { @@ -174,3 +175,11 @@ REGISTER_OP_CPU_KERNEL(p_norm, ops::PnormKernel, ops::PnormKernel); REGISTER_OP_CPU_KERNEL(p_norm_grad, ops::PnormGradKernel, ops::PnormGradKernel); +REGISTER_OP_VERSION(p_norm) + .AddCheckpoint( + R"ROC( + Upgrade p_norm, add 1 attribute [asvector]. + )ROC", + paddle::framework::compatible::OpVersionDesc().NewAttr( + "asvector", + "Compute as vector when axis is None and input is matrix", false));