Skip to content

Commit

Permalink
Content: Clarify the expected behavior for axes being empty (#599)
Browse files Browse the repository at this point in the history
The shape calculation for argMin/argMax and reduction ops is now
fully specified, but the implied behavior of {axes:[]} for these
ops and layerNormalization was not particularly clear.

Add a little text to make it clearer.

Fixes #493
  • Loading branch information
inexorabletash committed Mar 14, 2024
1 parent 09b471d commit 048e855
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ partial interface MLGraphBuilder {
<dl dfn-type=dict-member dfn-for=MLArgMinMaxOptions>
: <dfn>axes</dfn>
::
The dimensions to reduce. The values must be in the range [0, N-1] where N is the [=MLOperand/rank=] of the input tensor. If not present, all dimensions are reduced.
The dimensions to reduce. The values must be in the range [0, N-1] where N is the [=MLOperand/rank=] of the input tensor. If not present, all dimensions are reduced. If empty, no dimensions are reduced, and the shape of the output tensor is the same as the shape of the input tensor.

: <dfn>keepDimensions</dfn>
::
Expand Down Expand Up @@ -3527,8 +3527,7 @@ partial interface MLGraphBuilder {

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

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. If empty, no dimensions are reduced.
: <dfn>epsilon</dfn>
::
A small value to prevent computational error due to divide-by-zero.
Expand Down Expand Up @@ -4659,7 +4658,7 @@ partial interface MLGraphBuilder {
<dl dfn-type=dict-member dfn-for=MLReduceOptions>
: <dfn>axes</dfn>
::
The dimensions to reduce. The values in the list must be in the range [0, N-1] where N is the [=MLOperand/rank=] of the input tensor. If not present, all dimensions are reduced.
The dimensions to reduce. The values in the list must be in the range [0, N-1] where N is the [=MLOperand/rank=] of the input tensor. If not present, all dimensions are reduced. If empty, no dimensions are reduced, and the shape of the output tensor is the same as the shape of the input tensor.

: <dfn>keepDimensions</dfn>
::
Expand Down

0 comments on commit 048e855

Please sign in to comment.