Open ChrisRackauckas opened 2 years ago
This is so much code churn and would i think significantly inhibit readability. Julia itself should be improved to be able to handle these cases better.
If it doesn't we should bare this in mind for the ChainRulesCore 2.x timeframe.
Is it a good idea to code our own custom chain rules that way though?
Because closures are not consistent types, they inhibit precompilation. If the closures used for the adjoints were instead callable types, which would make sure that every session has the same types and thus they should in theory be amenable to precompilation. This would be a huge but non-breaking code churn. I wonder if everyone would be okay with that programming style. It would also help in many cases with inference, because closures are known to cause inference issues. So in general this could improve compile and run time performance quite a bit, but it's a bit nasty.