Skip to content

Commit

Permalink
Fix webmachinelearning#439: add missing conv2d() and convTranspose2d(…
Browse files Browse the repository at this point in the history
…) validation steps

Signed-off-by: Zoltan Kis <[email protected]>
  • Loading branch information
zolkis committed Jul 12, 2023
1 parent 567396b commit b7eaee9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2064,6 +2064,8 @@ partial interface MLGraphBuilder {
1. If |options| is `undefined`, let |options| be an empty [=object=].
1. If |options|.{{MLConv2dOptions/padding}} is `undefined`, set it to `[0, 0, 0, 0]`.
1. If |options|.{{MLConv2dOptions/strides}} is `undefined`, set it to `[1, 1]`.
1. Else if |options|.{{MLConv2dOptions/strides}}.size() is not `2`, then throw a "{{TypeError}}" {{DOMException}} and stop.
1. If any element in |options|.{{MLConv2dOptions/strides}} is equal to 0, then throw a "{{TypeError}}" {{DOMException}} and stop.
1. If |options|.{{MLConv2dOptions/dilations}} is `undefined`, set it to `[1, 1]`.
1. If |options|.{{MLConv2dOptions/autoPad}} is `undefined`, set it to `"explicit"`.
1. If |options|.{{MLConv2dOptions/groups}} is `undefined`, set it to `1`.
Expand Down Expand Up @@ -2230,6 +2232,8 @@ partial interface MLGraphBuilder {
1. If |options| is `undefined`, let |options| be an empty [=object=].
1. If |options|.{{MLConvTranspose2dOptions/padding}} is `undefined`, set it to `[0, 0, 0, 0]`.
1. If |options|.{{MLConvTranspose2dOptions/strides}} is `undefined`, set it to `[1, 1]`.
1. Else if |options|.{{MLConv2dOptions/strides}}.size() is not `2`, then throw a "{{TypeError}}" {{DOMException}} and stop.
1. If any element in |options|.{{MLConv2dOptions/strides}} is equal to 0, then throw a "{{TypeError}}" {{DOMException}} and stop.
1. If |options|.{{MLConvTranspose2dOptions/dilations}} is `undefined`, set it to `[1, 1]`.
1. If |options|.{{MLConvTranspose2dOptions/outputPadding}} is `undefined`, set it to `[0, 0]`.
1. If |options|.{{MLConvTranspose2dOptions/autoPad}} is `undefined`, set it to `"explicit"`.
Expand Down

0 comments on commit b7eaee9

Please sign in to comment.