-
Notifications
You must be signed in to change notification settings - Fork 48
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
Should MLBufferView + MLOperandDescriptor be strongly typed (as a MLTensor)? #275
Comments
Considerations:
|
Thanks @wacky6 .
Could it be validated by checking
This is an issue.
I suppose this would also support other fixed point types, e.g., int4, am I correct?
My question is whether the content of float32Array is copied into the constructed |
I think so.
In theory yes. But we should clearly define data layout of an arrayBuffer. Things like endiness, padding, etc. This can be a stretch goal, we can add support for them later. :)
I don't think copy is necessary at constructor time. TypedArray have a fixed length, it can't change in size (it can only be reshaped).
When MLTensor is used in compute() or dispatch(), the data can be copied (to avoid TOCTOU bugs) if necessary. |
Some issues with using a dict:
dimensions
isn't validated againstTypedArray.bytesLength
. I can set arbitrary dimensions (like[4,4,4]
to a Float32Array that only has 1 element.dict<NodeName, dict<data, dimensions>>
anddict<NodeName "data", NodeName "dimensions">
, thus fails to bind JavaScript object to C++ implementation.Discovered this during WebML prototyping for https://crbug.com/1338067
The text was updated successfully, but these errors were encountered: