-
Notifications
You must be signed in to change notification settings - Fork 163
Add documentation for the non_differentiable attribute (Closes #1271) #1663
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
| Class type support is under active development and thus, most of these | ||
| limitations will be removed soon. | ||
|
|
||
| The 'non_differentiable' Attribute |
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.
Perhaps we should have non_differentiable in code-format here?
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'd be even happier if we address this issue #418 before advertising the non-differentiable attribute. I like that syntax ([[clad::non_differentiable]]) a lot better than what we have currently but that's a separate story :)
| The 'non_differentiable' Attribute | ||
| ------------------------------------ | ||
|
|
||
| Clad allows users to mark specific variables,functions,or members as 'non-differentiable'. |
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.
| Clad allows users to mark specific variables,functions,or members as 'non-differentiable'. | |
| Clad allows users to mark specific variables, functions, or members as `non-differentiable`. |
|
|
||
| This feature is useful for: | ||
|
|
||
| **Handling Unsupported Types:** You can exclude pointers or legacy types (which are currently listed as limitations in Class differentiation) from the derivative computation.\ |
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.
| **Handling Unsupported Types:** You can exclude pointers or legacy types (which are currently listed as limitations in Class differentiation) from the derivative computation.\ | |
| **Handling Unsupported Types:** You can exclude pointers or legacy types (which are currently listed as limitations in Class differentiation) from the derivative computation. |
|
|
||
| .. code-block:: cpp | ||
| #define non_differentiable __attribute__((annotate("non_differentiable"))) |
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.
Perhaps Clad should provide this macro to users through the clad header file.
295a99d to
5138197
Compare
|
Thanks @parth-07 for reviewing the commit. |
3d84305 to
e9193f1
Compare
|
Hi @parth-07, |
| } | ||
| Here, ``df1/dx = 2x`` because the ``f`` contribution is excluded. | ||
|
|
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 break at the 80 column here as it seems to be the case in the rest of the document?
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.
Done! I have wrapped the text.
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.
It does not look like the text was fixed. Did you forget to push?
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.
Hi @vgvassilev
I have double checked the line and the line is within the 80 character limit ,the line splits after the "contribution is".
b52432c to
91a0f4f
Compare
a413616 to
d3a9418
Compare
This PR adds missing documentation for the "non_differentiable" attribute to the documentation.
Changes
docs/userDocs/source/user/UsingClad.rst: Added a new section "Thenon_differentiableAttribute" with syntax definitions and three concrete examples (variables, functions, classes).Verification
sphinx-build.