Skip to content

Commit

Permalink
Register op version for grid_sampler, test=op_version (PaddlePaddle#2…
Browse files Browse the repository at this point in the history
…9916)

* register op version for grid_sampler
  • Loading branch information
LielinJiang authored Dec 28, 2020
1 parent 5c162fe commit eab0b60
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions paddle/fluid/operators/grid_sampler_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License. */
#include <memory>
#include <string>
#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
Expand Down Expand Up @@ -237,3 +238,11 @@ REGISTER_OP_CPU_KERNEL(
grid_sampler_grad,
ops::GridSampleGradOpKernel<paddle::platform::CPUDeviceContext, float>,
ops::GridSampleGradOpKernel<paddle::platform::CPUDeviceContext, double>);

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"));

0 comments on commit eab0b60

Please sign in to comment.