test=develop, add op_register_version for roll_op (#30023)

* test=develop, add op_register_version for roll_op
revert-31562-mean
123malin 4 years ago committed by GitHub
parent e012930aa3
commit d0056c324d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,9 +13,9 @@
// limitations under the License.
#include "paddle/fluid/operators/roll_op.h"
#include <memory>
#include <vector>
#include "paddle/fluid/framework/op_version_registry.h"
namespace paddle {
namespace operators {
@ -142,3 +142,17 @@ REGISTER_OP_CPU_KERNEL(
ops::RollGradKernel<paddle::platform::CPUDeviceContext, double>,
ops::RollGradKernel<paddle::platform::CPUDeviceContext, int>,
ops::RollGradKernel<paddle::platform::CPUDeviceContext, int64_t>);
REGISTER_OP_VERSION(roll)
.AddCheckpoint(
R"ROC(
Upgrade roll add 1 attribute [axis], delete 1 attribute[dims].
)ROC",
paddle::framework::compatible::OpVersionDesc()
.NewAttr("axis",
"(std::vector<int64_t>) Axis along which to roll. "
"It must have the same size with shifts.",
std::vector<int64_t>())
.DeleteAttr("dims",
"(std::vector<int64_t>) Dims along which to roll. "
"It must have the same size with shifts."));

Loading…
Cancel
Save