Open gojakuch opened 4 weeks ago
reproducer:
#include "clad/Differentiator/Differentiator.h" #include "clad/Differentiator/STLBuiltins.h" #include <iostream> double fn(double x, double y) { std::vector<double> v{1, 2, 3}; // this doesn't work return v[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'; }
same thing is happening with other types
I guess what needs to be done is that we need some support of the initializer_list in the reverse mode and then we just need to make custom pullbacks for constructors that use it.
initializer_list
reproducer:
same thing is happening with other types