-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Small refactors and bug fixes. #2281
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
Conversation
src/relay/ir/expr.cc
Outdated
| bool FunctionNode::IsPrimitive() const { | ||
| NodeRef res = FunctionGetAttr(GetRef<Function>(this), "Primitive"); | ||
| const ir::IntImm* pval = res.as<ir::IntImm>(); | ||
| return pval && pval->value != 0; |
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.
I think the indentation is not needed.
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.
also fix this since it's failing CI lint test.
| * | ||
| * \return Whether the function is primitive or not. | ||
| */ | ||
| bool IsPrimitive() const; |
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.
Maybe replace this line with the new API?
https://github.com/dmlc/tvm/blob/01cfdb7ebcef0abc9282f68c3c4484974a6cc6e1/src/relay/pass/fuse_ops.cc#L702
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.
Yeah I was cherry-picking changes from an old branch 😄 got distracted at TVM conference while working on this PR.
wweic
left a comment
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.
Thanks! LGTM
I'm starting the process of upstreaming the bits and pieces of Relay we developed while prototyping new features. This PR is composed of bug fixes and refactors which should make it easier to port those changes.