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

Convert "If descriptor.dimensions does not exist, then descriptor defines a scalar input." from assertion to note #502

Closed
inexorabletash opened this issue Jan 10, 2024 · 0 comments · Fixed by #575

Comments

@inexorabletash
Copy link
Member

In MLGraphBuilder's input() method steps:

Assert: If descriptor.dimensions does not exist, then descriptor defines a scalar input.

This doesn't appear to be an assertion, rather it seems to be describing (non-normatively) how to interpret the descriptor.

Convert this to a note?

inexorabletash added a commit to inexorabletash/webnn that referenced this issue Feb 16, 2024
…achinelearning#502

MLOperandDescriptor was updated in c320472 to always have dimensions,
defaulted to an empty list for scalars. That makes the current prose
for input() incorrect. Issue webmachinelearning#502 already tracked correcting it, so
let's simplify - just change the logic for "is a scalar?" and drop the
bogus assert.
@fdwr fdwr closed this as completed in #575 Feb 21, 2024
fdwr added a commit that referenced this issue Feb 21, 2024
* Bug fix: Fix MLGraphBuilder.input()'s handling of scalars. Fixes #502

MLOperandDescriptor was updated in c320472 to always have dimensions,
defaulted to an empty list for scalars. That makes the current prose
for input() incorrect. Issue #502 already tracked correcting it, so
let's simplify - just change the logic for "is a scalar?" and drop the
bogus assert.

* Remove conditional and fix check dimensions to allow 0
* Factor byte length check into checking dimensions
* Oops, this should go too.
* type -> dataType
* (1) simplify (2) move into MLOperandDescriptor (3) link to #456
* Restore dimension check and reorder byte length to last
* Fix build for missing dimensions

---------

Co-authored-by: Dwayne Robinson <dwayner@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants