Skip to content

Commit

Permalink
Merge pull request webmachinelearning#538 from inexorabletash/bugfix-…
Browse files Browse the repository at this point in the history
…layernormalization-axes

Bug fix: Provide default for MLLayerNormalizationOptions axes in steps
  • Loading branch information
fdwr authored Feb 10, 2024
2 parents 5a6869e + b6c8489 commit e3f32fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3656,7 +3656,7 @@ partial interface MLGraphBuilder {

: <dfn>axes</dfn>
::
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.
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.

: <dfn>epsilon</dfn>
::
Expand All @@ -3676,6 +3676,7 @@ partial interface MLGraphBuilder {
The <dfn method for=MLGraphBuilder>layerNormalization(|input|, |options|)</dfn> method steps are:
</summary>
<div class=algorithm-steps>
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.
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}}.
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}}.
1. [=list/For each=] |index| in [=the range=] 0 to the [=list/size=] of |options|.{{MLLayerNormalizationOptions/axes}}, exclusive:
Expand Down

0 comments on commit e3f32fe

Please sign in to comment.