Skip to content

Commit

Permalink
Wording change: Add types to all internal algorithm members (#536)
Browse files Browse the repository at this point in the history
  • Loading branch information
inexorabletash authored Feb 6, 2024
1 parent f9b86b6 commit c9d2dd7
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ Its <a>default allowlist</a> is <code>'self'</code>.

<details open algorithm>
<summary>
To <dfn>create a context</dfn> given |options|, run these steps:
To <dfn>create a context</dfn> given |options| (a {{GPUDevice}} or {{MLContextOptions), run these steps:
</summary>
<div class=algorithm-steps>
1. Let |context| be a new {{MLContext}} object.
Expand Down Expand Up @@ -933,7 +933,7 @@ The {{MLActivation}} objects (including the ones passed as input to methods) are

<details open algorithm>
<summary>
To <dfn>create an MLActivation</dfn> given |builder|, |name|, optional |options| and optional |init-steps|, run the following steps:
To <dfn>create an MLActivation</dfn> given {{MLGraphBuilder}} |builder|, [=string=] |name|, optional [=ordered map=] |options| and optional algorithm |init-steps|, run the following steps:
</summary>
<div class=algorithm-steps>
1. Let |activation| be a new {{MLActivation}}.
Expand Down Expand Up @@ -1170,7 +1170,7 @@ partial interface MLContext {

<details open algorithm>
<summary>
To <dfn>validate graph resources</dfn>, given |resources| and |descriptors|, run the following steps:
To <dfn>validate graph resources</dfn>, given {{MLNamedArrayBufferViews}} |resources| and [=ordered map=] |descriptors|, run the following steps:
</summary>
<div class=algorithm-steps>
1. [=map/For each=] |name| &rarr; |resource| of |resources|:
Expand All @@ -1182,7 +1182,7 @@ partial interface MLContext {

<details open algorithm>
<summary>
To <dfn>validate buffer with descriptor</dfn> given |bufferView| and |descriptor|, run the following steps:
To <dfn>validate buffer with descriptor</dfn> given {{MLBufferView}} |bufferView| and {{MLOperandDescriptor}} |descriptor|, run the following steps:
</summary>
<div class=algorithm-steps>
1. If |bufferView|'s [=element type=] does not match to |descriptor|.{{MLOperandDescriptor/dataType}} according to [this table](#appendices-mloperanddatatype-arraybufferview-compatibility), return false.
Expand All @@ -1192,7 +1192,7 @@ partial interface MLContext {

<details open algorithm>
<summary>
To <dfn>execute graph</dfn>, given |graph|, |inputs| and |outputs|, run the following steps:
To <dfn>execute graph</dfn>, given {{MLGraph}} |graph|, {{MLNamedArrayBufferViews}} |inputs| and {{MLNamedArrayBufferViews}} |outputs|, run the following steps:
</summary>
<div class=algorithm-steps>
1. Let |inputResources| denote the input resources of |graph|.{{MLGraph/[[implementation]]}}.
Expand Down Expand Up @@ -1516,7 +1516,7 @@ partial interface MLGraphBuilder {

<details open algorithm>
<summary>
To <dfn for="MLGraphBuilder" data-lt="argminmax-op">create argMin/argMax operation</dfn> given |op|, {{MLOperand}} |input| and {{MLArgMinMaxOptions}} |options|, run the following steps:
To <dfn for="MLGraphBuilder" data-lt="argminmax-op">create argMin/argMax operation</dfn> given [=string=] |op|, {{MLOperand}} |input| and {{MLArgMinMaxOptions}} |options|, run the following steps:
</summary>
<div class=algorithm-steps>
1. [=Assert=]: |op| is one of "argMin", "argMax".
Expand Down Expand Up @@ -1785,7 +1785,7 @@ partial interface MLGraphBuilder {

<details open algorithm>
<summary>
To <dfn>check clamp options</dfn> given |options|, run the following steps:
To <dfn>check clamp options</dfn> given {{MLClampOptions}} |options|, run the following steps:
</summary>
<div class=algorithm-steps>
1. If |options|.{{MLClampOptions/minValue}} is greater than |options|.{{MLClampOptions/maxValue}}, then return false.
Expand Down Expand Up @@ -2380,7 +2380,7 @@ partial interface MLGraphBuilder {

<details open algorithm>
<summary>
To <dfn for="MLGraphBuilder" data-lt="element-wise-binary-op">create element-wise binary operation</dfn> given |op|, {{MLOperand}} |a| and {{MLOperand}} |b|, run the following steps:
To <dfn for="MLGraphBuilder" data-lt="element-wise-binary-op">create element-wise binary operation</dfn> given [=string=] |op|, {{MLOperand}} |a| and {{MLOperand}} |b|, run the following steps:
</summary>
<div class=algorithm-steps>
1. [=Assert=]: |op| is one of "add", "sub", "mul", "div", "max", "min", "pow".
Expand All @@ -2404,7 +2404,7 @@ partial interface MLGraphBuilder {

<details open algorithm>
<summary>
To <dfn for="MLGraphBuilder">broadcast-shapes</dfn> given |shape1| and |shape2|, run the following steps:
To <dfn for="MLGraphBuilder">broadcast-shapes</dfn> given [=/list=] |shape1| and [=/list=] |shape2|, run the following steps:
</summary>
<div class=algorithm-steps>
1. [=Assert=]: The type of |shape1| and |shape2| is `sequence of unsigned long`.
Expand Down Expand Up @@ -2513,7 +2513,7 @@ Although operations *greaterOrEqual* and *lesserOrEqual* can each be implemented

<details open algorithm>
<summary>
To <dfn for="MLGraphBuilder" data-lt="element-wise-logical-op">create element-wise logical operation</dfn> given |op|, {{MLOperand}} |a| and an optional {{MLOperand}} |b|, run the following steps:
To <dfn for="MLGraphBuilder" data-lt="element-wise-logical-op">create element-wise logical operation</dfn> given [=string=] |op|, {{MLOperand}} |a| and an optional {{MLOperand}} |b|, run the following steps:
</summary>
<div class=algorithm-steps>
1. [=Assert=]: |op| is one of "equal", "greater", "greaterOrEqual", "lesser", "lesserOrEqual", "not".
Expand Down Expand Up @@ -2635,7 +2635,7 @@ partial interface MLGraphBuilder {

<details open algorithm>
<summary>
To <dfn for="MLGraphBuilder" data-lt="element-wise-unary-op">create element-wise unary operation</dfn> given |op| and {{MLOperand}} |input|, run the following steps:
To <dfn for="MLGraphBuilder" data-lt="element-wise-unary-op">create element-wise unary operation</dfn> given [=string=] |op| and {{MLOperand}} |input|, run the following steps:
</summary>
<div class=algorithm-steps>
1. [=Assert=]: |op| is one of "abs", "ceil", "cos", "erf", "exp", "floor", "identity", "log", "neg", "reciprocal", "sin", "sqrt", "tan".
Expand Down Expand Up @@ -4789,7 +4789,7 @@ partial interface MLGraphBuilder {

<details open algorithm>
<summary>
To <dfn for="MLGraphBuilder" data-lt="pooling-op">create pooling operation</dfn> given |op|, {{MLOperand}} |input| and {{MLPool2dOptions}} |options|, run the following steps:
To <dfn for="MLGraphBuilder" data-lt="pooling-op">create pooling operation</dfn> given [=string=] |op|, {{MLOperand}} |input| and {{MLPool2dOptions}} |options|, run the following steps:
</summary>
<div class=algorithm-steps>
1. [=Assert=]: |op| is one of "averagePool2d", "l2Pool2d", "maxPool2d".
Expand Down Expand Up @@ -4970,7 +4970,7 @@ partial interface MLGraphBuilder {

<details open algorithm>
<summary>
To <dfn for="MLGraphBuilder" data-lt="reduce-op">create reduce operation</dfn> given |op|, {{MLOperand}} |input| and {{MLReduceOptions}} |options|, run the following steps:
To <dfn for="MLGraphBuilder" data-lt="reduce-op">create reduce operation</dfn> given [=string=] |op|, {{MLOperand}} |input| and {{MLReduceOptions}} |options|, run the following steps:
</summary>
<div class=algorithm-steps>
1. [=Assert=]: |op| is one of "reduceL1", "reduceL2", "reduceLogSum", "reduceLogSumExp", "reduceMax", "reduceMean", "reduceMin", "reduceProduct", "reduceSum", "reduceSumSquare".
Expand Down Expand Up @@ -6116,7 +6116,7 @@ The {{MLOperand}} objects are created by the methods of {{MLGraphBuilder}}, inte

<details open algorithm>
<summary>
To <dfn>check dimensions</dfn> given |dimensions| and |type|, run the following steps:
To <dfn>check dimensions</dfn> given [=/list=] |dimensions| and {{MLOperandDataType}} |type|, run the following steps:
</summary>
<div class=algorithm-steps>
1. If the [=list/size=] of |dimensions| is 0, return false.
Expand Down

0 comments on commit c9d2dd7

Please sign in to comment.