Add version checking (#30040)

revert-31562-mean
whs 4 years ago committed by GitHub
parent 4d395203a2
commit 1b999d2b5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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>{}));

Loading…
Cancel
Save