-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Support match pvar with dtype constraint #9016
Support match pvar with dtype constraint #9016
Conversation
CC @spectrometerHBH @tqchen @Hzfengsy would you guys review this patch? |
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.
overall LGTM, two minor comments on naming. Thanks @wrongtest
src/arith/pattern_match.h
Outdated
*/ | ||
template <typename T, typename DType, | ||
typename = std::enable_if<std::is_base_of<T, PrimExpr>::value>> | ||
class PVarWithType : public PVarWithCheck<PVarWithType<T, DType>, T> { |
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.
Would be great to rename to PVarWithDataType
src/arith/pattern_match.h
Outdated
/*! | ||
* \brief Pattern variable container for data type with lanes. | ||
*/ | ||
class PVecType : public PVarWithCheck<PVecType, DataType> { |
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.
PVecDataType
Thanks @wrongtest ! This PR is now merged |
* main: [3/10] Moved TIR generation from Python to C++ for CMSIS-NN (apache#8951) Support match pvar with dtype constraint (apache#9016)
This PR add two helper class for tir expression pattern match.
PVarWithType
works same asPVar
with dtype matchPVecType
represent a wildcard vec type placeholder same asPVar<DataType>
, but with element dtype match