-
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
default to convert #1
Comments
@CarloLucibello @MikeInnes Any thoughts on this? I think that |
The problem is that adapt can be called with anything, e.g. It might be good to see motivating use cases where opt-out would be better, but the answer might be that you just want a different construct than |
Ahhh good point. What if we did something like this: function adapt_(T, x)
try
convert(T, x)
catch
x
end
end It’s certainly not the prettiest code, but it has the desired effect - for example, in the CuArrays example, arrays will be converted to CuArrays, and other types will stay the same. Sent with GitHawk |
This is not going to happen at this point anymore, as it would be a significant change to a package that's been stable for a very long time. A |
why we have this
instead of
so that
adapt
could be used as an opt-out replacement to convert?Bye
C
The text was updated successfully, but these errors were encountered: