Skip to content

Commit

Permalink
Fix typo in "LayerNormalization" docs (onnx#5351)
Browse files Browse the repository at this point in the history
### Description
Fix typo in "LayerNormalization" node's description.
Now it is said that attribute "axis" can be equal to "rank(X)", which
has no sense.
If you look in [tests
implementation](https://github.com/onnx/onnx/blob/main/onnx/backend/test/case/node/layernormalization.py#L13-L58),
you will see that it will produce tensor of zeroes. And [current tests
list](https://github.com/onnx/onnx/tree/main/onnx/backend/test/data/node)
doesn't include such case. Based on these facts, i assume it is just a
typo.

### Motivation and Context
It is a very confusing typo. Me and collegues spent some time trying to
figure out, what tensor this case should produce.

---------

Signed-off-by: Rail <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Xavier Dupré <[email protected]>
Co-authored-by: G. Ramalingam <[email protected]>
Co-authored-by: Chun-Wei Chen <[email protected]>
Co-authored-by: Justin Chu <[email protected]>
  • Loading branch information
5 people authored Aug 9, 2023
1 parent c2f534f commit 2ae09c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21029,7 +21029,7 @@ This version of the operator has been available since version 17 of the default

<dl>
<dt><tt>axis</tt> : int (default is -1)</dt>
<dd>The first normalization dimension. If rank(X) is r, axis' allowed range is [-r, r]. Negative value means counting dimensions from the back.</dd>
<dd>The first normalization dimension. If rank(X) is r, axis' allowed range is [-r, r). Negative value means counting dimensions from the back.</dd>
<dt><tt>epsilon</tt> : float (default is 1e-05)</dt>
<dd>The epsilon value to use to avoid division by zero.</dd>
<dt><tt>stash_type</tt> : int (default is 1)</dt>
Expand Down
2 changes: 1 addition & 1 deletion docs/Operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -12782,7 +12782,7 @@ This version of the operator has been available since version 17 of the default

<dl>
<dt><tt>axis</tt> : int (default is -1)</dt>
<dd>The first normalization dimension. If rank(X) is r, axis' allowed range is [-r, r]. Negative value means counting dimensions from the back.</dd>
<dd>The first normalization dimension. If rank(X) is r, axis' allowed range is [-r, r). Negative value means counting dimensions from the back.</dd>
<dt><tt>epsilon</tt> : float (default is 1e-05)</dt>
<dd>The epsilon value to use to avoid division by zero.</dd>
<dt><tt>stash_type</tt> : int (default is 1)</dt>
Expand Down
2 changes: 1 addition & 1 deletion onnx/defs/nn/defs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2630,7 +2630,7 @@ ONNX_OPERATOR_SET_SCHEMA(
.SetDoc(LayerNormalization_ver17_doc)
.Attr(
"axis",
"The first normalization dimension. If rank(X) is r, axis' allowed range is [-r, r]. "
"The first normalization dimension. If rank(X) is r, axis' allowed range is [-r, r). "
"Negative value means counting dimensions from the back.",
AttributeProto::INT,
static_cast<int64_t>(-1))
Expand Down

0 comments on commit 2ae09c2

Please sign in to comment.