You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
of course, the produced code might change in Clad from time to time, but this is invalid C++ (for multiple reasons actually, but some of them are covered in other issues). this issue is about the following problem. on the line
clad::ValueAndAdjoint<double &, double &> _t3 = clad::custom_derivatives::class_functions::operator_subscript_reverse_forw(&a, i, &_d_a, _r1);
we save the result of the reverse_forw operation into the _t3 variable, which is created inside a for-loop. we then access this variable outside of this loop during the reverse pass later in the generated code. not only is this invalid C++, this is actually very hard to fix by manipulating the generated code manually, which is frustrating for the user.
The text was updated successfully, but these errors were encountered:
this might be a duplicate, for I think I've seen a similar issue, but I couldn't find it. anyway, here's the reproducer:
Clad generates:
of course, the produced code might change in Clad from time to time, but this is invalid C++ (for multiple reasons actually, but some of them are covered in other issues). this issue is about the following problem. on the line
we save the result of the reverse_forw operation into the
_t3
variable, which is created inside a for-loop. we then access this variable outside of this loop during the reverse pass later in the generated code. not only is this invalid C++, this is actually very hard to fix by manipulating the generated code manually, which is frustrating for the user.The text was updated successfully, but these errors were encountered: