Skip to content

Commit

Permalink
Clarify behavior in ConvTranspose (onnx#2343)
Browse files Browse the repository at this point in the history
* Fix the wrong behavior in ConvTranspose

* Address comments
  • Loading branch information
wschin authored Sep 21, 2019
1 parent a20ba2f commit c5af774
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10762,7 +10762,7 @@ This version of the operator has been available since version 11 of the default
<dt><tt>kernel_shape</tt> : list of ints</dt>
<dd>The shape of the convolution kernel. If not present, should be inferred from input W.</dd>
<dt><tt>output_padding</tt> : list of ints</dt>
<dd>The zero-padding added to one side of the output. This is also called adjs/adjustment in some frameworks.</dd>
<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>
<dt><tt>output_shape</tt> : list of ints</dt>
<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>
<dt><tt>pads</tt> : list of ints</dt>
Expand Down
2 changes: 1 addition & 1 deletion docs/Operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,7 @@ Other versions of this operator: <a href="Changelog.md#ConvTranspose-1">ConvTran
<dt><tt>kernel_shape</tt> : list of ints</dt>
<dd>The shape of the convolution kernel. If not present, should be inferred from input W.</dd>
<dt><tt>output_padding</tt> : list of ints</dt>
<dd>The zero-padding added to one side of the output. This is also called adjs/adjustment in some frameworks.</dd>
<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>
<dt><tt>output_shape</tt> : list of ints</dt>
<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>
<dt><tt>pads</tt> : list of ints</dt>
Expand Down
12 changes: 10 additions & 2 deletions onnx/defs/nn/defs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1299,8 +1299,16 @@ output_shape can also be explicitly specified in which case pads values are auto
OPTIONAL);
schema.Attr(
"output_padding",
"The zero-padding added to one side of the output."
" This is also called adjs/adjustment in some frameworks.",
"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.",
AttributeProto::INTS,
OPTIONAL);
schema.Attr(
Expand Down

0 comments on commit c5af774

Please sign in to comment.