未验证 提交 1b999d2b 编写于 作者: W whs 提交者: GitHub

Add version checking (#30040)

上级 4d395203
......@@ -17,6 +17,7 @@ limitations under the License. */
#include <string>
#include <vector>
#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
......@@ -271,3 +272,11 @@ REGISTER_OP_CPU_KERNEL(
affine_grid_grad,
ops::AffineGridGradOpKernel<paddle::platform::CPUDeviceContext, float>,
ops::AffineGridGradOpKernel<paddle::platform::CPUDeviceContext, double>);
REGISTER_OP_VERSION(affine_grid)
.AddCheckpoint(
R"ROC(
Compatible upgrade of affine_grid, add a new attribute [align_corners])ROC",
paddle::framework::compatible::OpVersionDesc().NewAttr(
"align_corners",
"Whether to align the corners of input and output.", true));
......@@ -14,6 +14,7 @@ limitations under the License. */
#include <string>
#include <vector>
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/op_version_registry.h"
#include "paddle/fluid/operators/detection/bbox_util.h"
#include "paddle/fluid/operators/gather.h"
#include "paddle/fluid/operators/math/concat_and_split.h"
......@@ -713,3 +714,16 @@ REGISTER_OPERATOR(
REGISTER_OP_CPU_KERNEL(generate_proposal_labels,
ops::GenerateProposalLabelsKernel<float>,
ops::GenerateProposalLabelsKernel<double>);
REGISTER_OP_VERSION(generate_proposal_labels)
.AddCheckpoint(
R"ROC(
Upgrade of output [MaxOverlapWithGT])ROC",
paddle::framework::compatible::OpVersionDesc().NewOutput(
"MaxOverlapWithGT",
"The maxoverlap between output RoIs and ground-truth."))
.AddCheckpoint(
R"ROC(
Upgrade generate_proposal_labels add a new input [MaxOverlap])ROC",
paddle::framework::compatible::OpVersionDesc().NewInput(
"MaxOverlap", "MaxOverlap is dispensable."));
......@@ -210,7 +210,7 @@ REGISTER_OP_VERSION(gaussian_random)
.NewInput("ShapeTensorList",
"The output shape supports list filled with Tensor. "
"ShapeTensorList is dispensable.")
.ModifyAttr(
"shape",
"Add the default value of shape, the default value is {}.",
{}));
.ModifyAttr("shape",
"The arg 'default_value' of attr 'shape' is changed: "
"from 'None' to '{}'.",
std::vector<int64_t>{}));
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册