Skip to content

Commit e3f32fe

Browse files
authored
Merge pull request webmachinelearning#538 from inexorabletash/bugfix-layernormalization-axes
Bug fix: Provide default for MLLayerNormalizationOptions axes in steps
2 parents 5a6869e + b6c8489 commit e3f32fe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.bs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3656,7 +3656,7 @@ partial interface MLGraphBuilder {
36563656

36573657
: <dfn>axes</dfn>
36583658
::
3659-
The indices to the input dimensions to reduce. When this member is not present, it is assumed to be [1,2,3] that is, the reduction for the mean and variance values are calculated across all the input features for each individual sample in the batch.
3659+
The indices to the input dimensions to reduce. When this member is not present, it is treated as if all dimensions except the first were given (e.g. for a 4-D input tensor, axes = [1,2,3]). That is, the reduction for the mean and variance values are calculated across all the input features for each independent batch.
36603660

36613661
: <dfn>epsilon</dfn>
36623662
::
@@ -3676,6 +3676,7 @@ partial interface MLGraphBuilder {
36763676
The <dfn method for=MLGraphBuilder>layerNormalization(|input|, |options|)</dfn> method steps are:
36773677
</summary>
36783678
<div class=algorithm-steps>
3679+
1. If |options|.{{MLLayerNormalizationOptions/axes}} does not [=map/exist=], then set |options|.{{MLLayerNormalizationOptions/axes}} to a new [=/list=], either equal to [=the range=] from 1 to |input|'s [=rank-=], exclusive, if |input|'s [=rank=] is greater than 1, or an empty [=/list=] otherwise.
36793680
1. If the [=rank=] of |options|.{{MLLayerNormalizationOptions/scale}} is not equal to the [=list/size=] of |options|.{{MLLayerNormalizationOptions/axes}}, then [=exception/throw=] a "{{DataError}}" {{DOMException}}.
36803681
1. If the [=rank=] of |options|.{{MLLayerNormalizationOptions/bias}} is not equal to the [=list/size=] of |options|.{{MLLayerNormalizationOptions/axes}}, then [=exception/throw=] a "{{DataError}}" {{DOMException}}.
36813682
1. [=list/For each=] |index| in [=the range=] 0 to the [=list/size=] of |options|.{{MLLayerNormalizationOptions/axes}}, exclusive:

0 commit comments

Comments
 (0)