未验证 提交 1c898b66 编写于 作者: W Wilber 提交者: GitHub

add bug fix enum. (#26736)

上级 8071d230
......@@ -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].
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册