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
However, when I do "return 0" instead of "return x * 0", it calculates the derivative always equal to zero. I assumed that somehow the constant confuses the library, but the following functions finds the correct derivative:
Mysterious, this definitely is a bug (and I've confirmed it locally). My guess is that activity analysis is being a bit too aggressive. I'll get back with a fix shortly.
I've been playing around with Enzyme. Enzyme seems to be able to find the derivative of the following function just fine
double fun(double x) {
if(x>=0) return x;
return x * 0;
}
However, when I do "return 0" instead of "return x * 0", it calculates the derivative always equal to zero. I assumed that somehow the constant confuses the library, but the following functions finds the correct derivative:
double fun(double x) {
if(x<=1) return x;
return 1;
}
so, I guess it might be something to do with zero? I am not sure.
The text was updated successfully, but these errors were encountered: