-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[DimExpr] DimExpr support print #60146
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
@@ -239,4 +240,8 @@ class ValueShape { | |||
|
|||
using ValueShapeDimExprs = ValueShape<DimExpr>; |
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
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
有道理,本函数的返回值是 std::string
,因此改成了 ToString
DimExpr 已经重载了 operator<<
函数,因此打印时还可以直接调用 VLOG,例如 VLOG(1)<<dim_expr
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.
LGTM
* DimExpr support print * ToTxtString * Fix ASSERT_EQ bug * Fix typo * Fix unittest * ToTxtString->ToString * Fix windows CI * ShapeOrData cannot use IR_API
PR types
New features
PR changes
Others
Description
pcard-76996
[DimExpr] DimExpr support print
See
test/cpp/pir/shape_dialect/symbol_dim_expr_test.cc
for the print result.