From eab0b60e16a41fa0f526a5cf046d4473f06774be Mon Sep 17 00:00:00 2001 From: LielinJiang <50691816+LielinJiang@users.noreply.github.com> Date: Mon, 28 Dec 2020 11:57:19 +0800 Subject: [PATCH] Register op version for grid_sampler, test=op_version (#29916) * register op version for grid_sampler --- paddle/fluid/operators/grid_sampler_op.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/paddle/fluid/operators/grid_sampler_op.cc b/paddle/fluid/operators/grid_sampler_op.cc index 3d34a3d15c..e357133be4 100644 --- a/paddle/fluid/operators/grid_sampler_op.cc +++ b/paddle/fluid/operators/grid_sampler_op.cc @@ -16,6 +16,7 @@ limitations under the License. */ #include #include #include "paddle/fluid/framework/op_registry.h" +#include "paddle/fluid/framework/op_version_registry.h" #ifdef PADDLE_WITH_CUDA #include "paddle/fluid/platform/cudnn_helper.h" #endif @@ -237,3 +238,11 @@ REGISTER_OP_CPU_KERNEL( grid_sampler_grad, ops::GridSampleGradOpKernel, ops::GridSampleGradOpKernel); + +REGISTER_OP_VERSION(grid_sampler) + .AddCheckpoint( + R"ROC( + Upgrade grid_sampler add a new attribute [mode]. + )ROC", + paddle::framework::compatible::OpVersionDesc().NewAttr( + "mode", "In order to specify interpolation mode", "bilinear")); -- GitLab