Re: [whatwg/webidl] Float16Array integration (Issue #1310)

Re: WebNN: At this point we don't anticipate needing a type in WebIDL for float16, since API methods each accept a wide variety of data types, and in all cases the data type is either explicitly given as sibling argument or implicit based on other inputs. When dealing with float16 data, callers are either passing a `Float16Array` (a "tensor") into a method defined in WebIDL to accept an `ArrayBufferView`, or a single ("scalar") value where the method would take either a `double` (caller passes a JS number) or a `(double or bigint)` (caller passes a JS number or BigInt) and then it is internally down-cast as needed to float16. 

There's a very very draft PR of what this might look like in https://github.com/webmachinelearning/webnn/pull/647 - this sketches out some of the casting that might be needed. Since some of the conversion logic duplicates stuff in WebIDL it could be nice to refactor and export some of the WebIDL abstract operations, but (1) it's premature to do so now and (2) even if done we'd just need the operations, not a defined `half` or `unrestricted half` type.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1310#issuecomment-2118002851
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1310/2118002851@github.com>

Received on Friday, 17 May 2024 16:52:54 UTC