Skip to content

Swap parameters of scalar constant() operand method#650

Merged
fdwr merged 25 commits into
webmachinelearning:mainfrom
inexorabletash:constant-arg-order
Jun 4, 2024
Merged

Swap parameters of scalar constant() operand method#650
fdwr merged 25 commits into
webmachinelearning:mainfrom
inexorabletash:constant-arg-order

Conversation

@inexorabletash

@inexorabletash inexorabletash commented Apr 18, 2024

Copy link
Copy Markdown
Contributor

Make MLGraphBuilder's constant() operand-vending methods consistent and take the data type as the first parameter. This implicitly makes the type required instead of optional.

Use of constant() in decompositions are updated as well, and now use "input" consistently instead of "x" sometimes.

Fixes #475


Preview | Diff

Make MLGraphBuilder's constant() operand-vending methods consistent
and take the data type as the first parameter. This implicitly makes
the type required instead of optional.

Use of constant() in decompositions are updated as well, and now use
"input" consistently instead of "x" sometimes.

Fixes #475
@inexorabletash

Copy link
Copy Markdown
Contributor Author

FYI, I ran clang-format --assume-filename=.js --style=Chromium over the decompositions that were significantly touched. I'll write a script to apply that to all of the sample JS blocks in the script and put that up as a separate CL.

@inexorabletash

Copy link
Copy Markdown
Contributor Author

I'm going to drop this to "draft" to take it off people's radar. This would be a breaking change for lots of content, so we'll want to approach it carefully.

@inexorabletash inexorabletash marked this pull request as draft May 1, 2024 23:07
@inexorabletash inexorabletash marked this pull request as ready for review May 28, 2024 18:26
@inexorabletash

Copy link
Copy Markdown
Contributor Author

I didn't realize until last week that Chromium didn't implement the scalar version of constant(), so this should be safe to change - no content should be relying on it, right?

Comment thread index.bs Outdated
@inexorabletash inexorabletash requested review from fdwr and huningxin May 30, 2024 21:12
@inexorabletash

Copy link
Copy Markdown
Contributor Author

@huningxin & @fdwr - please take a look?

@huningxin huningxin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You may also want to update the code sample of explainer https://github.com/webmachinelearning/webnn/blob/main/explainer.md?plain=1#L38

Comment thread index.bs
@inexorabletash

Copy link
Copy Markdown
Contributor Author

You may also want to update the code sample of explainer https://github.com/webmachinelearning/webnn/blob/main/explainer.md?plain=1#L38

Done in 1d9fb59

@huningxin huningxin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@fdwr fdwr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks JB. Small suggestions for your consideration.

Comment thread index.bs
Comment thread index.bs
Comment thread index.bs
Comment thread index.bs
Comment thread index.bs
@fdwr

fdwr commented Jun 4, 2024

Copy link
Copy Markdown
Collaborator

All suggestions moot because addressed elsewhere. So merging...

@fdwr fdwr merged commit 91e2407 into webmachinelearning:main Jun 4, 2024
github-actions Bot added a commit that referenced this pull request Jun 4, 2024
SHA: 91e2407
Reason: push, by fdwr

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@inexorabletash

Copy link
Copy Markdown
Contributor Author

I realized too late that the updated decompositions all use input.dataType not input.dataType(). I guess that's a vote in favor of that change proposed in #666 but it was unintentional!

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.

Remove builder.constant(value, type) variant

4 participants