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

Make MLOperandDescriptor.dimensions a FrozenArray #670

Closed
a-sully opened this issue Apr 30, 2024 · 3 comments
Closed

Make MLOperandDescriptor.dimensions a FrozenArray #670

a-sully opened this issue Apr 30, 2024 · 3 comments
Labels

Comments

@a-sully
Copy link
Contributor

a-sully commented Apr 30, 2024

Here's the guidance from WebIDL which applies to MLOperandDescriptor.dimensions:

A frozen array type is a parameterized type whose values are references to objects that hold a fixed length array of unmodifiable values

This is relevant to the discussion in #666 about providing a getter to return an MLOperandDescriptor

@inexorabletash
Copy link
Member

Note that per WebIDL:

Since FrozenArray<T> values are references, they are unlike sequence types, which are lists of values that are passed by value.

This is relevant for any spec text that operates on descriptor.dimensions as if it's a by-value list. My gut feeling is that most specs treat FrozenArray<T> the same as sequence<T> except that Object.freeze() will be applied at the point where a value is returned to script, but there may be more subtlety than that.

@anssiko
Copy link
Member

anssiko commented May 27, 2024

The WebIDL spec is considering removing support for FrozenArray<T> as a dictionary member type: whatwg/webidl#1399

We should share our use case in that issue if we feel this change is important for this API.

@a-sully
Copy link
Contributor Author

a-sully commented May 28, 2024

Ah, thanks for the pointer. I don't think there are specific reasons why this API needs to use FrozenArray. The arguments laid out in that issue apply here, so if FrozenArray is to be removed then I think we should WontFix this issue

@a-sully a-sully closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants