Skip to content

Commit 05b15b1

Browse files
Validate restriction of output padding in convTranspose2d (#631)
When outputShapes is not specified, the output padding must be smaller than the stride along the same dimension. This matches the Chromium prototype implementation. Fixes #630
1 parent fd8a8d0 commit 05b15b1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.bs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,6 +2130,8 @@ partial interface MLGraphBuilder {
21302130
1. Else if |options|.{{MLConvTranspose2dOptions/outputPadding}}'s [=list/size=] is not 2, then [=exception/throw=] a {{TypeError}}.
21312131
1. If |options|.{{MLConvTranspose2dOptions/outputSizes}} [=map/exists=]:
21322132
1. If |options|.{{MLConvTranspose2dOptions/outputSizes}}'s [=list/size=] is not 2, then [=exception/throw=] a {{TypeError}}.
2133+
1. Otherwise:
2134+
1. If |options|.{{MLConvTranspose2dOptions/outputPadding}}[0] is greater than or equal to |options|.{{MLConvTranspose2dOptions/strides}}[0], or |options|.{{MLConvTranspose2dOptions/outputPadding}}[1] is greater than or equal to |options|.{{MLConvTranspose2dOptions/strides}}[1], then [=exception/throw=] a {{TypeError}}.
21332135
1. *Calculate the output shape:*
21342136
1. Switch on |options|.{{MLConvTranspose2dOptions/inputLayout}}:
21352137
<dl class=switch>

0 commit comments

Comments
 (0)