Skip to content
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

Upper bound Adapt to avoid test failure. #314

Closed
wants to merge 2 commits into from
Closed

Conversation

andreasnoack
Copy link
Member

@jishnub would you be able to review?

@jishnub
Copy link
Member

jishnub commented Nov 3, 2024

Perhaps it'll be better to update the failing test here, instead of restricting the version? I think we can change

Adapt.adapt_storage(::ArrayConverter, xs::AbstractArray) = convert(Array, xs)

to use Adapt.adapt_structure instead of Adapt.adapt_storage? The following method appears to be narrower than the current one, and works on both versions:

Adapt.adapt_structure(::ArrayConverter, xs::UnitRange) = convert(Array, xs)

It is also closer in intent to what is being tested.

@jishnub
Copy link
Member

jishnub commented Nov 11, 2024

Rebasing on master should fix the invalidation test failure

@andreasnoack
Copy link
Member Author

I forgot to answer here. It wasn't immediately obvious to me what the tests were intended to cover so I didn't feel comfortable adjusting them but if you believe your change above aligns with the original intent of the tests then I think we should go with that instead of this PR.

@jishnub
Copy link
Member

jishnub commented Nov 27, 2024

@aplavin might be able to suggest, as I think he's familiar with Adapt. In general, Adapt.adapt_structure appears to be the recommended route instead of the lower-level Adapt.adapt_storage

@aplavin
Copy link
Member

aplavin commented Nov 27, 2024

Sorry, I don't really work with Adapt, have no idea about its functions.

@jishnub
Copy link
Member

jishnub commented Dec 2, 2024

Is this unnecessary now after #317?

@andreasnoack
Copy link
Member Author

I think so

@andreasnoack andreasnoack deleted the an/boundadapt branch December 2, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants