-
Notifications
You must be signed in to change notification settings - Fork 123
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
Fix gradient computation of higher order functions #645
Conversation
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.
clang-tidy made some suggestions
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #645 +/- ##
=======================================
Coverage 94.12% 94.12%
=======================================
Files 43 43
Lines 6295 6300 +5
=======================================
+ Hits 5925 5930 +5
Misses 370 370
|
c013c5f
to
dee9a90
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
dee9a90
to
72a3890
Compare
clang-tidy review says "All clean, LGTM! 👍" |
addToCurrentBlock(add_assign, direction::reverse); | ||
// FIXME: not sure if this is generic. | ||
// Don't update derivatives of non-record types. | ||
if (!decl->getType()->isRecordType()) { |
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.
Can we check this with isa<RecordDecl>(decl)
?
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 had that earlier but it failed with clang-16. isRecordType
does the same thing inside it, but performs the operation on the CanonicalType instead of the qualified type.
source code of isRecordType.
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.
Ah, ok. That means that if we did isa<RecordDecl>(decl->getCanonicalDecl())
would work?
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.
Yup, that works. I saw isRecordType
being used at different places in our codebase, so I used that.
Should I change this to use isa<RecordDecl>
? Any reason to prefer that?
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.
Nope, let's use your current solution if it is used elsewhere.
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!
fixes #637