Skip to content

docs: default_device() can be None #961

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ev-br
Copy link
Member

@ev-br ev-br commented Jun 23, 2025

closes gh-923.

Per discussion in the community meeting, https://hackmd.io/zn5bvdZTQIeJmb3RW1B-8g#Meeting-minutes-15-May-2025 and the resolution of #923 (comment), spell out explicitly that None is an allowed return value of the default_device.

@lucascolley lucascolley changed the title DOC: default_device can be None docs: default_device() can be None Jun 23, 2025
@jakevdp
Copy link

jakevdp commented Jun 23, 2025

A comment here: the wording implies that None has a special meaning – but my understanding is that the spec makes no requirements of what objects libraries use to represent devices, and so adding special meaning to None is not really necessary.

In the motivating example, JAX doesn't use None to mean that "the default device is not predictable due to library specific device placement rules", it uses None to represent the concept of uncommitted placement on the default device.

@ev-br
Copy link
Member Author

ev-br commented Jun 23, 2025

JAX ... uses None to represent the concept of uncommitted placement on the default device.

This is one example of thea library specific device placement rule, I'd say :-).

That said, there's nothing special about the proposed wording here. Anything which says "None is allowed" is strictly better than what's in main, so if you've PR with a better wording, I'm happy to close this PR in favor of yours.

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.

clarify if __array_namespace_info().default_device() can be None
2 participants