We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
#include "clad/Differentiator/Differentiator.h" #include "clad/Differentiator/STLBuiltins.h" #include <iostream> double fn(double x, double y) { std::vector<double> a; a.push_back(x); a[0] *= x; return a[0]; } int main(int argc, char* argv[]) { double dx, dy; auto df = clad::gradient(fn, "x, y"); std::cout << fn(3, 4) << '\n'; dx = 0; dy = 0; df.execute(3, 4, &dx, &dy); std::cout << dx << ' ' << dy << '\n'; }
in the generated code for the line a[0] *= x clad uses a variable that is only created during the reverse pass later on.
a[0] *= x
the reason for this has been mentioned in #1076. this issue is related to #1066 which is the same problem, but for constructors and not operators.
The text was updated successfully, but these errors were encountered:
reverse_forw
No branches or pull requests
in the generated code for the line
a[0] *= x
clad uses a variable that is only created during the reverse pass later on.the reason for this has been mentioned in #1076. this issue is related to #1066 which is the same problem, but for constructors and not operators.
The text was updated successfully, but these errors were encountered: