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

Bug fix: Fix MLGraphBuilder.input()'s handling of scalars #575

Merged
merged 9 commits into from
Feb 21, 2024

Conversation

inexorabletash
Copy link
Member

@inexorabletash inexorabletash commented Feb 16, 2024

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. The "check dimensions" algorithm is streamlined, and constant()'s use is also simplified.

Fixes #502


Preview | Diff

…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.
index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
Copy link
Collaborator

@fdwr fdwr left a comment

Choose a reason for hiding this comment

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

👍 Ningxin said he'd be back next week if you can wait a little longer (I don't want to complete too many CR's without my editorial partner 😅), but LGTM.

index.bs Outdated Show resolved Hide resolved
Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

The fix of MLGraphBuilder.input() LGTM, thanks!

Just left a comment for check dimensions algorithm, I am fine we fix it in a separate PR.

index.bs Outdated Show resolved Hide resolved
index.bs Outdated Show resolved Hide resolved
@inexorabletash
Copy link
Member Author

At the risk of scope creep: Editors, what do you think of moving the definition of check dimensions either (1) into MLOperandDescriptor, adjacent to byte length, or (2) into Algorithms? With the PR as-is, putting it in with MLOperandDescriptor might be preferred

Copy link
Contributor

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks much!

index.bs Show resolved Hide resolved
@inexorabletash inexorabletash changed the title Bug fix: Fix MLGraphBuilder.input()'s handling of scalars. Fixes #502 Bug fix: Fix MLGraphBuilder.input()'s handling of scalars Feb 21, 2024
@inexorabletash
Copy link
Member Author

LGTM thanks @fdwr !

@fdwr fdwr merged commit 6e99b01 into webmachinelearning:main Feb 21, 2024
2 checks passed
@inexorabletash inexorabletash deleted the bugfix-input-dimensions branch February 21, 2024 23:24
github-actions bot added a commit that referenced this pull request Feb 21, 2024
SHA: 6e99b01
Reason: push, by fdwr

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

@huningxin huningxin left a comment

Choose a reason for hiding this comment

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

The latest change LGTM, thanks @fdwr !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants