Skip to content

Commit

Permalink
[Doc clarification] Added unidirectional text for LayerNorm (#5686)
Browse files Browse the repository at this point in the history
### Description
Doc only, added clarification that scale and B can be uni-directionally
expanded to X. Current def is not explicit on this point.

### Motivation and Context
Clarification of docs to be more explicit. 
Issue discussed here #5666

---------

Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
  • Loading branch information
AlexandreEichenberger and justinchuby committed Oct 19, 2023
1 parent 42b0662 commit bbe7011
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docs/Changelog.md
Expand Up @@ -21043,7 +21043,9 @@ This version of the operator has been available since version 17 of the default
Let `d[i]` indicate the i-th dimension of `X`.
If `X`'s shape is `[d[0], ..., d[axis-1], d[axis], ..., d[rank-1]]`,
the shape of `Mean` and `InvStdDev` is `[d[0], ..., d[axis-1], 1, ..., 1]`.
`Y` and `X` have the same shape.
`Y` and `X` have the same shape. This operator supports unidirectional broadcasting
(tensors `Scale` and `B` should be unidirectional broadcastable to tensor `X`);
for more details please check [the doc](Broadcasting.md).

#### Version

Expand Down
4 changes: 3 additions & 1 deletion docs/Operators.md
Expand Up @@ -13172,7 +13172,9 @@ expect(
Let `d[i]` indicate the i-th dimension of `X`.
If `X`'s shape is `[d[0], ..., d[axis-1], d[axis], ..., d[rank-1]]`,
the shape of `Mean` and `InvStdDev` is `[d[0], ..., d[axis-1], 1, ..., 1]`.
`Y` and `X` have the same shape.
`Y` and `X` have the same shape. This operator supports unidirectional broadcasting
(tensors `Scale` and `B` should be unidirectional broadcastable to tensor `X`);
for more details please check [the doc](Broadcasting.md).

#### Version

Expand Down
4 changes: 3 additions & 1 deletion onnx/defs/nn/defs.cc
Expand Up @@ -2516,7 +2516,9 @@ static const char* LayerNormalization_ver17_doc = R"DOC(
Let `d[i]` indicate the i-th dimension of `X`.
If `X`'s shape is `[d[0], ..., d[axis-1], d[axis], ..., d[rank-1]]`,
the shape of `Mean` and `InvStdDev` is `[d[0], ..., d[axis-1], 1, ..., 1]`.
`Y` and `X` have the same shape.
`Y` and `X` have the same shape. This operator supports unidirectional broadcasting
(tensors `Scale` and `B` should be unidirectional broadcastable to tensor `X`);
for more details please check [the doc](Broadcasting.md).
)DOC";

bool BuildContextDependentFunctionBodyLayerNormalization(
Expand Down

0 comments on commit bbe7011

Please sign in to comment.