-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[DimExpr] DimExpr support print #60146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
cfeafa6
e0f3714
7593413
114ea8d
d2a04f6
152f7d0
68c5b77
515a70b
69063ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,4 +92,17 @@ TEST(DimExpr, equal) { | |
builder.Broadcast(DimExpr("S0"), constant1)); | ||
} | ||
|
||
TEST(DimExpr, print) { | ||
DimExprBuilder builder{nullptr}; | ||
DimExpr sym0 = DimExpr("S0"); | ||
DimExpr sym1 = DimExpr("S1"); | ||
ASSERT_EQ((ToTxtString(sym0 + sym1)), "Add(S0, S1)"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 函数名是否有点冗长,ToString就可以吧,或者PIR里其实都用的是Print,我觉得可以保持一致 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 有道理,本函数的返回值是 |
||
ASSERT_EQ((ToTxtString(sym0 - sym1)), "Add(S0, -S1)"); | ||
ASSERT_EQ((ToTxtString(sym0 * sym1)), "Mul(S0, S1)"); | ||
ASSERT_EQ((ToTxtString(sym0 / sym1)), "Mul(S0, 1 / (S1))"); | ||
ASSERT_EQ((ToTxtString(builder.Max(sym0, sym1))), "Max(S0, S1)"); | ||
ASSERT_EQ((ToTxtString(builder.Min(sym0, sym1))), "Min(S0, S1)"); | ||
ASSERT_EQ((ToTxtString(builder.Broadcast(sym0, sym1))), "Broadcast(S0, S1)"); | ||
} | ||
|
||
} // namespace symbol::test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个地方不该应再叫ValueShape了吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
命名修改完毕:#60056