Skip to content

Commit 38f9261

Browse files
incorporate fdwr's suggestions
1 parent a610b9e commit 38f9261

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

index.bs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,10 +1558,10 @@ partial interface MLGraphBuilder {
15581558
1. If |variance|'s [=MLOperand/rank=] is not 1, then [=exception/throw=] a {{TypeError}}.
15591559
1. If |variance|'s [=MLOperand/shape=][0] is not equal to |input|'s [=MLOperand/shape=][|options|.{{MLBatchNormalizationOptions/axis}}], then [=exception/throw=] a {{TypeError}}.
15601560
1. If |options|.{{MLBatchNormalizationOptions/scale}} [=map/exists=]:
1561-
1. If its [=list/size=] is not 1, then [=exception/throw=] a {{TypeError}}.
1561+
1. If its [=MLOperand/rank=] is not 1, then [=exception/throw=] a {{TypeError}}.
15621562
1. If |options|.{{MLBatchNormalizationOptions/scale}}'s [=MLOperand/shape=][0] is not equal to |input|'s [=MLOperand/shape=][|options|.{{MLBatchNormalizationOptions/axis}}], then [=exception/throw=] a {{TypeError}}.
15631563
1. If |options|.{{MLBatchNormalizationOptions/bias}} [=map/exists=]:
1564-
1. If its [=list/size=] is not 1, then [=exception/throw=] a {{TypeError}}.
1564+
1. If its [=MLOperand/rank=] is not 1, then [=exception/throw=] a {{TypeError}}.
15651565
1. If |options|.{{MLBatchNormalizationOptions/bias}}'s [=MLOperand/shape=][0] is not equal to |input|'s [=MLOperand/shape=][|options|.{{MLBatchNormalizationOptions/axis}}], then [=exception/throw=] a {{TypeError}}.
15661566
1. *Make graph connections:*
15671567
1. Let |operator| be an [=operator=] for the batchNormalization operation, given |input|, |mean|, |variance| and |options|.
@@ -4720,7 +4720,7 @@ partial interface MLGraphBuilder {
47204720

47214721
: <dfn>keepDimensions</dfn>
47224722
::
4723-
If true, retains reduced dimensions with [=list/size=] 1.
4723+
If true, the output has the same rank as the input, setting any reduced dimensions to size 1.
47244724
</dl>
47254725

47264726
<div>
@@ -5179,7 +5179,7 @@ partial interface MLGraphBuilder {
51795179
The <dfn method for=MLGraphBuilder>slice(|input|, |starts|, |sizes|)</dfn> method steps are:
51805180
</summary>
51815181
1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}.
5182-
1. If |sizes|'s [=list/size=] is 0, then [=exception/throw=] a {{TypeError}}.
5182+
1. If any of |sizes|'s [=list/items=] are 0, then [=exception/throw=] a {{TypeError}}.
51835183
1. If |starts|'s [=list/size=] and |sizes|'s [=list/size=] are not both equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}.
51845184
1. *Make graph connections:*
51855185
1. Let |output| be the result of [=copying an MLOperand=] given |input|.
@@ -5777,17 +5777,17 @@ Broadcasting refers to how operations treat tensors with different shapes, and f
57775777

57785778
<details open algorithm>
57795779
<summary>
5780-
To <dfn data-lt="unidirectionally broadcasting the shapes">unidirectionally broadcast the shapes</dfn> |A| and |B|, perform the following steps. |A| and |B| are [=/lists=] of positive integers, representing the dimensions of tensors, and the steps return a new [=/list=] of positive integers, or failure.
5780+
To <dfn data-lt="unidirectionally broadcasting the shapes">unidirectionally broadcast the shapes</dfn> |shapeA| and |shapeB|, perform the following steps. |shapeA| and |shapeB| are [=/lists=] of positive integers, representing the dimensions of tensors, and the steps return a new [=/list=] of positive integers, or failure.
57815781
</summary>
57825782

5783-
1. Let |sizeA| be |A|'s [=list/size=].
5784-
1. Let |sizeB| be |B|'s [=list/size=].
5783+
1. Let |sizeA| be |shapeA|'s [=list/size=].
5784+
1. Let |sizeB| be |shapeB|'s [=list/size=].
57855785
1. If |sizeB| > |sizeA|, then return failure.
5786-
1. Let |paddedB| be a [=list/clone=] of |B|.
5786+
1. Let |paddedB| be a [=list/clone=] of |shapeB|.
57875787
1. While |paddedB|'s [=list/size=] is less than |sizeA|, [=list/prepend=] 1 to |paddedB|.
57885788
1. Let |outputShape| be a new [=/list=].
57895789
1. [=list/For each=] |index| in [=the range=] 0 to |sizeA|, exclusive:
5790-
1. Let |dimA| be |A|[|index|].
5790+
1. Let |dimA| be |shapeA|[|index|].
57915791
1. Let |dimB| be |paddedB|[|index|].
57925792
1. If |dimA| is not equal to |dimB| and |dimA| is not equal to 1, then return failure.
57935793
1. [=list/Append=] |dimA| to |outputShape|.
@@ -5796,20 +5796,20 @@ To <dfn data-lt="unidirectionally broadcasting the shapes">unidirectionally broa
57965796
</details>
57975797

57985798
<p algorithm>
5799-
|A| is <dfn>unidirectionally broadcastable</dfn> to |B| if [=unidirectionally broadcasting the shapes=] |A| and |B| does not result in failure.
5799+
|shapeA| is <dfn>unidirectionally broadcastable</dfn> to |shapeB| if [=unidirectionally broadcasting the shapes=] |shapeA| and |shapeB| does not result in failure.
58005800
</p>
58015801

58025802
<details open algorithm>
58035803
<summary>
5804-
To <dfn data-lt="bidirectionally broadcasting the shapes">bidirectionally broadcast the shapes</dfn> |A| and |B|, perform the following steps. |A| and |B| are [=/lists=] of positive integers, representing the dimensions of tensors, and the steps return a new [=/list=] of positive integers, or failure.
5804+
To <dfn data-lt="bidirectionally broadcasting the shapes">bidirectionally broadcast the shapes</dfn> |shapeA| and |shapeB|, perform the following steps. |shapeA| and |shapeB| are [=/lists=] of positive integers, representing the dimensions of tensors, and the steps return a new [=/list=] of positive integers, or failure.
58055805
</summary>
58065806

5807-
1. Let |sizeA| be |A|'s [=list/size=].
5808-
1. Let |sizeB| be |B|'s [=list/size=].
5807+
1. Let |sizeA| be |shapeA|'s [=list/size=].
5808+
1. Let |sizeB| be |shapeB|'s [=list/size=].
58095809
1. Let |outputSize| be the maximum of |sizeA| and |sizeB|.
5810-
1. Let |paddedA| be a [=list/clone=] of |A|.
5810+
1. Let |paddedA| be a [=list/clone=] of |shapeA|.
58115811
1. While |paddedA|'s [=list/size=] is less than |outputSize|, [=list/prepend=] 1 to |paddedA|.
5812-
1. Let |paddedB| be a [=list/clone=] of |B|.
5812+
1. Let |paddedB| be a [=list/clone=] of |shapeB|.
58135813
1. While |paddedB|'s [=list/size=] is less than |outputSize|, [=list/prepend=] 1 to |paddedB|.
58145814
1. Let |outputShape| be a new [=/list=].
58155815
1. [=list/For each=] |index| in [=the range=] 0 to |outputSize|, exclusive:
@@ -5822,7 +5822,7 @@ To <dfn data-lt="bidirectionally broadcasting the shapes">bidirectionally broadc
58225822
</details>
58235823

58245824
<p algorithm>
5825-
|A| is <dfn>bidirectionally broadcastable</dfn> to |B| if [=bidirectionally broadcasting the shapes=] |A| and |B| does not result in failure.
5825+
|shapeA| is <dfn>bidirectionally broadcastable</dfn> to |shapeB| if [=bidirectionally broadcasting the shapes=] |shapeA| and |shapeB| does not result in failure.
58265826
</p>
58275827

58285828
Examples {#examples}

0 commit comments

Comments
 (0)