-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Backwards compatibility: We should allow functions to be named _jacobian that don't use the new feature to be called anywhere for a few versions #1470
Comments
@nhuurre -- do you have any sense of how this could be done in a way that isn't so horrible? |
Options:
Also pinging @SteveBronder |
I think the easiest backwards-compatibility hack would be that right before calling let jacobian_compatibilty_mode = ref false
let suffix_from_name name =
match Fun_kind.suffix_from_name name with
| FnJacobian when !jacobian_compatibilty_mode -> Fun_kind.FnPlain
| f -> f Trying to do this on a per-function basis gets complicated if there are mutually recursive |
I agree. I had just finished sketching out a graph search over the functions (while not entirely knowing how to resolve overloads to do so), when it occurred to me that for backwards compatibility purposes a global check is sufficient. If we see the new feature, we don’t have to worry about this being an old model… |
We took care to implement
jacobian+=
in a backwards-compatible way, but not_jacobian
functions, of which there are some in the wild: https://github.com/search?q=language%3Astan+_jacobian%28&type=codeBecause these functions don't need the
jacobian +=
feature, ideally they would continue to be treated asFnPlain
s, with a warning. I'm not sure if this is actually implementable, however, due to the order-independence of the functions block.First reported by @tillahoffmann https://discourse.mc-stan.org/t/planning-the-2-36-release/36382/15?u=wardbrian
The text was updated successfully, but these errors were encountered: