Fix test failure if no device parameter - #459
Open
prady0t wants to merge 3 commits into
Open
Conversation
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
ev-br
reviewed
Aug 20, 2026
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Signed-off-by: Pradyot Ranjan <99216956+pradyotRanjan@users.noreply.github.com>
Member
|
I tried testing this PR with MLX since that's the only library which supports DLPack but does not have the |
3 tasks
betatim
reviewed
Aug 21, 2026
| try: | ||
| x = xp.empty(2, device=device) | ||
| except: | ||
| # also covers libraries that does not support device parameter |
Member
There was a problem hiding this comment.
Suggested change
| # also covers libraries that does not support device parameter | |
| # also covers libraries that do not support device parameter |
betatim
reviewed
Aug 21, 2026
| x = xp.empty(2, device=device) | ||
| try: | ||
| x = xp.empty(2, device=device) | ||
| except: |
Member
There was a problem hiding this comment.
Maybe we should make this except TypeError (I think this is the exception?) to make sure we only catch errors that are due to the fact that there is no device keyword argument.
Even better would be having a way to inspect the array library/function to determine if there is a device argument or not. This would be explicitly checking what we want to know
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #458