-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support for arbitrary callables #84
Comments
This is a known limitation; Adapt currently only works with callable objects (functions, closures) as emitted by the Julia front-end. Why are you even declaring |
I am working on a package downstream of SciMLBase where I have some objects subtyping from https://github.com/SciML/SciMLBase.jl/blob/e3a0de8451d7a924807975de892673404c5b8d9a/src/SciMLBase.jl#L578 to represent my PDE discretization and I simply wanted to have a reproducer for the issue with similar structure to what I do (and to show that the issue is not subtyping per-se but subtyping from
I was not able to find reproduce the issue for normal functions.
Please note that Adapt works as expected in the cases when
I am currently simply use 2 to work around this issue. I just wanted to report this since I spend a bit of time to track this down the exact problem, so others don't have to. |
@ChrisRackauckas What's the reason for the |
It's a function, it has |
All objects are callable when you add methods to its type. Why does it need the |
It's pretty common for people to annotate callable structs as |
adapt_structure
fails if there are mixed concrete types and parametric types in a function type.Tests:
The text was updated successfully, but these errors were encountered: