Skip to content

Commit c5af774

Browse files
authored
Clarify behavior in ConvTranspose (#2343)
* Fix the wrong behavior in ConvTranspose * Address comments
1 parent a20ba2f commit c5af774

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

docs/Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10762,7 +10762,7 @@ This version of the operator has been available since version 11 of the default
1076210762
<dt><tt>kernel_shape</tt> : list of ints</dt>
1076310763
<dd>The shape of the convolution kernel. If not present, should be inferred from input W.</dd>
1076410764
<dt><tt>output_padding</tt> : list of ints</dt>
10765-
<dd>The zero-padding added to one side of the output. This is also called adjs/adjustment in some frameworks.</dd>
10765+
<dd>Additional elements added to the side with higher coordinate indices in the output. Each padding value in "output_padding" must be less than the corresponding stride/dilation dimension. By default, this attribute is a zero vector. Note that this attribute doesn't directly affect the computed output values. It only controls the selection of the computed values, so changing this attribute only adds or removes output elements. If "output_shape" is explicitly provided, "output_padding" does not contribute additional size to "output_shape" but participates in the computation of the needed padding amount. This is also called adjs or adjustment in some frameworks.</dd>
1076610766
<dt><tt>output_shape</tt> : list of ints</dt>
1076710767
<dd>The shape of the output can be explicitly set which will cause pads values to be auto generated. If output_shape is specified pads values are ignored. See doc for details for equations to generate pads</dd>
1076810768
<dt><tt>pads</tt> : list of ints</dt>

docs/Operators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,7 @@ Other versions of this operator: <a href="Changelog.md#ConvTranspose-1">ConvTran
29482948
<dt><tt>kernel_shape</tt> : list of ints</dt>
29492949
<dd>The shape of the convolution kernel. If not present, should be inferred from input W.</dd>
29502950
<dt><tt>output_padding</tt> : list of ints</dt>
2951-
<dd>The zero-padding added to one side of the output. This is also called adjs/adjustment in some frameworks.</dd>
2951+
<dd>Additional elements added to the side with higher coordinate indices in the output. Each padding value in "output_padding" must be less than the corresponding stride/dilation dimension. By default, this attribute is a zero vector. Note that this attribute doesn't directly affect the computed output values. It only controls the selection of the computed values, so changing this attribute only adds or removes output elements. If "output_shape" is explicitly provided, "output_padding" does not contribute additional size to "output_shape" but participates in the computation of the needed padding amount. This is also called adjs or adjustment in some frameworks.</dd>
29522952
<dt><tt>output_shape</tt> : list of ints</dt>
29532953
<dd>The shape of the output can be explicitly set which will cause pads values to be auto generated. If output_shape is specified pads values are ignored. See doc for details for equations to generate pads</dd>
29542954
<dt><tt>pads</tt> : list of ints</dt>

onnx/defs/nn/defs.cc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,8 +1299,16 @@ output_shape can also be explicitly specified in which case pads values are auto
12991299
OPTIONAL);
13001300
schema.Attr(
13011301
"output_padding",
1302-
"The zero-padding added to one side of the output."
1303-
" This is also called adjs/adjustment in some frameworks.",
1302+
"Additional elements added to the side with higher coordinate indices in the output. "
1303+
"Each padding value in \"output_padding\" must be less than the corresponding stride/dilation dimension. "
1304+
"By default, this attribute is a zero vector. "
1305+
"Note that this attribute doesn't directly affect the computed output values. "
1306+
"It only controls the selection of the computed values, "
1307+
"so changing this attribute only adds or removes output elements. "
1308+
"If \"output_shape\" is explicitly provided, "
1309+
"\"output_padding\" does not contribute additional size to \"output_shape\" but "
1310+
"participates in the computation of the needed padding amount. "
1311+
"This is also called adjs or adjustment in some frameworks.",
13041312
AttributeProto::INTS,
13051313
OPTIONAL);
13061314
schema.Attr(

0 commit comments

Comments
 (0)