-
Notifications
You must be signed in to change notification settings - Fork 122
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
Use clad::zero_vector instead of 0 in the vectorized forward mode #1140
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
97afee2
to
7714af5
Compare
clang-tidy review says "All clean, LGTM! 👍" |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1140 +/- ##
=======================================
Coverage 94.48% 94.48%
=======================================
Files 50 50
Lines 8850 8850
=======================================
Hits 8362 8362
Misses 488 488
|
clang-tidy review says "All clean, LGTM! 👍" |
576d015
to
906f05a
Compare
clang-tidy review says "All clean, LGTM! 👍" |
Now the array is uninitialized. |
I think I understand the issue -- can you separate this PR into two separate ones? |
…ensure type safety. This is necessary to ensure type safety. ``0`` represents a zero vector but is only properly treated as a zero vector when it gets added/subtracted with a ``clad::array``. Initializing a ``clad::array`` with ``0`` will create not a zero vector but an empty array (with zero elements). To fix this, we needed exceptions for all declarations. We would need to make new exceptions when passing parameters to pushforwards.
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!
clang-tidy review says "All clean, LGTM! 👍" |
This is necessary to ensure type safety.
0
represents a zero vector but is only properly treated as a zero vector when it gets added/subtracted with aclad::array
. Initializing aclad::array
with0
will create not a zero vector but an empty array (with zero elements). To fix this, we needed exceptions for all declarations. We would need to make new exceptions when passing parameters to pushforwards.After merging this PR and #1121, #527 will be fixed automatically.