add bug fix enum. (#26736)

revert-26856-strategy_example2
Wilber 5 years ago committed by GitHub
parent 8071d23073
commit 1c898b66d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,7 +34,8 @@ struct OpUpdateRecord {
kModifyAttr,
kNewAttr,
kNewInput,
kNewOutput
kNewOutput,
kBugfixWithBehaviorChanged,
};
Type type_;
std::string remark_;
@ -82,6 +83,11 @@ struct NewOutput : OpUpdateRecord {
std::string name_;
};
struct BugfixWithBehaviorChanged : OpUpdateRecord {
explicit BugfixWithBehaviorChanged(const std::string& remark)
: OpUpdateRecord({Type::kBugfixWithBehaviorChanged, remark}) {}
};
class OpVersionDesc {
public:
OpVersionDesc& ModifyAttr(const std::string& name, const std::string& remark,
@ -110,6 +116,12 @@ class OpVersionDesc {
return *this;
}
OpVersionDesc& BugfixWithBehaviorChanged(const std::string& remark) {
infos_.push_back(std::shared_ptr<OpUpdateRecord>(
new compatible::BugfixWithBehaviorChanged(remark)));
return *this;
}
private:
std::vector<std::shared_ptr<OpUpdateRecord>> infos_;
};

@ -23,6 +23,10 @@ namespace compatible {
TEST(test_operator_version, test_operator_version) {
REGISTER_OP_VERSION(test__)
.AddCheckpoint(
R"ROC(Fix the bug of reshape op, support the case of axis < 0)ROC",
framework::compatible::OpVersionDesc().BugfixWithBehaviorChanged(
"Support the case of axis < 0"))
.AddCheckpoint(
R"ROC(
Upgrade reshape, modified one attribute [axis] and add a new attribute [size].

Loading…
Cancel
Save