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

Introduce MLConstantOperand #747

Closed
wants to merge 3 commits into from

Conversation

a-sully
Copy link
Contributor

@a-sully a-sully commented Jul 30, 2024

Fixes #668


Preview | Diff

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
<div class=internal-slots>
{{MLConstantOperand}} has the following internal slots:
<dl dfn-type=attribute dfn-for="MLConstantOperand">
: <dfn>\[[data]]</dfn> of type [=byte sequence=]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking about how future spec text would specify the actual operation on tensor data... should this just be a list of numbers instead of a byte sequence? Otherwise every access to a tensor would have to invoke an algorithm to get the numbers, and that would need to reference "decoding" the byte sequence. Sure, that can be wrapped in helpers, but is there any benefit to holding the bytes here vs. just a list of numbers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thinking. I agree that sounds nice :)

This is making me realize that I've never before had to specify anything touching the contents of an ArrayBufferView... For the constant(descriptor, bufferView) method, how do I get a [/list] of numbers out of the bufferView?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not finding an example and I can't think of a place outside ECMAScript itself that would need to. You may have to write it yourself, using GetValueFromBuffer which get a copy of the bytes does.

@a-sully
Copy link
Contributor Author

a-sully commented Sep 30, 2024

Closing due to #668 (comment)

@a-sully a-sully closed this Sep 30, 2024
@a-sully a-sully deleted the mlconstantoperand branch September 30, 2024 22:05
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.

Do we need an MLConstantOperand?
2 participants