-
Notifications
You must be signed in to change notification settings - Fork 52
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
RFC: add inspection support for querying the maximum number of supported dimensions #694
Comments
Thanks @kgryte. Seems reasonable to me to add this.
It is not unlikely that there is no such value for some libraries, it may be infinite. If you can instantiate an empty array with a fixed memory cost rather than it increasing with the number of dimensions, there's no reason that there must be a max rank. So allow |
IIRC PyTorch allows it to be infinite (through broadcast). But why not just use library-specific |
Allowing |
It doesn't matter too much, but |
Sounds good to me. I support this RFC. |
In #640, we proposed adding a unified inspection API namespace, and, in that proposal, we included support for querying array library capabilities.
That RFC includes two capabilities:
In this RFC, I'd like to propose a third; namely, the ability to query the maximum number of supported dimensions. This RFC is related to #479, where it was requested that the specification provide better guidance regarding the minimum upper bound array rank. During Consortium working group meetings, a minimum upper bound of
4
has been discussed.As such, different array libraries are likely to support different upper bounds, and downstream libraries should have an ergonomic means for determine what that upper bound is in order to ensure portable code. This RFC proposes that we add another field to the dictionary returned by
info.capabilities()
: max_rank.As currently written, #640 requires dictionary values be booleans. This RFC would require that requirement to be relaxed, such that dictionary values may, in general, be any value, but specific dictionary keys must be assigned values of a particular type. In this case, max_rank should have an integer value.
The text was updated successfully, but these errors were encountered: