Bugfix: Add missing validation for conv2d() and convTranspose2d()#706
Merged
huningxin merged 1 commit intowebmachinelearning:mainfrom Jun 13, 2024
Merged
Conversation
fdwr
approved these changes
Jun 12, 2024
Collaborator
fdwr
left a comment
There was a problem hiding this comment.
👍 Thanks for bringing spec and implementation to more congruence.
inexorabletash
approved these changes
Jun 12, 2024
| </dl> | ||
| 1. If |inputChannels| is not equal to |filterInputChannels|, then [=exception/throw=] a {{TypeError}}. | ||
| 1. Let |outputChannels| be |filterOutputChannels| * |options|.{{MLConvTranspose2dOptions/groups}} | ||
| 1. Let |outputChannels| be |filterOutputChannels| * |options|.{{MLConvTranspose2dOptions/groups}}. |
Contributor
There was a problem hiding this comment.
Aside: We could add a lint check that algorithm steps end with : or .
github-actions bot
added a commit
that referenced
this pull request
Jun 13, 2024
SHA: 96198a4 Reason: push, by huningxin Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
fdwr
pushed a commit
that referenced
this pull request
Feb 22, 2025
* Add missing validation steps for several ops A follow-on to #706 and the [audit](https://docs.google.com/spreadsheets/d/1S5-bMWN1hDrkPGiHFCyX-OjcbEBj1a-aWNdtTQ2dcGg) by @huningxin that adds validation steps to several ops identified for edge cases in the Chromium prototype implementation. This touches the following ops: - convTranspose2d - outputSizes items must be valid dimensions - lstm - steps must be greater than 0 - pool2d - windowDimensions must be greater than 0 - pool2d - outputSizes items must be valid dimensions - pool2d - specified output sizes must be floor() or ceil() of calculated output sizes - split - splits (if a number) must be greater than 0 Fixes #818 as well. * Review feedback
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to audit result of Chromium prototype, there are a few missing validations in the spec. This PR adds missing validations for conv2d() and convTranspose2d(). Other missing validations will be addressed by follow-up PRs.
@inexorabletash @fdwr , PTAL.
Preview | Diff