Skip to content

Commit f6a9af1

Browse files
authored
Merge pull request #703 from a-sully/remove-some-mlactivations
Remove MLActivations definitely not usable with recurrent ops
2 parents 8c98db0 + e948f7e commit f6a9af1

File tree

1 file changed

+2
-49
lines changed

1 file changed

+2
-49
lines changed

index.bs

+2-49
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ The {{MLGraphBuilder}} interface serves as a builder (factory) to construct a [=
640640

641641
In WebNN, a [=computational graph=] is composed of <dfn>operators</dfn> which act on data, and are the nodes of the graph. {{MLOperand}}s are a representation of data that flows within the computational graph, and are the edges of the graph. {{MLOperand}}s include a [=computational graph=]'s <dfn for="computational graph">input</dfn> values for inference, <dfn for="computational graph">constants</dfn> (including trained weights) used for inference, intermediate values (often referred to as activations) computed during inference, as well as the output values of inference. An [=operator=]'s <dfn for=operator>input</dfn> is one or more {{MLOperand}}s. An [=operator=]'s <dfn for=operator>output</dfn> is one or more {{MLOperand}}s. [=Operators=] have operator-specific parameters that control their behavior, which can include zero or more <dfn for=operator lt="activation|activation function">activation functions</dfn>, which are {{MLActivation}}s.
642642

643-
A key part of the {{MLGraphBuilder}} interface are methods such as {{MLGraphBuilder/gemm()}} and {{MLGraphBuilder/softmax(axis)|softmax()}} which create an [=operator=] which represents the actual operation to perform on the input data when the computation is run, and return a new {{MLOperand}} or {{MLActivation}} holding the operator. Methods that create an {{MLOperand}} connect any [=operator/inputs=] and [=operator/activations=] to the operator. Each method invocation returns a distinct new value, without changing the value of any other {{MLOperand}}.
643+
A key part of the {{MLGraphBuilder}} interface are methods such as {{MLGraphBuilder/gemm()}} and {{MLGraphBuilder/relu()}} which create an [=operator=] which represents the actual operation to perform on the input data when the computation is run, and return a new {{MLOperand}} or {{MLActivation}} holding the operator. Methods that create an {{MLOperand}} connect any [=operator/inputs=] and [=operator/activations=] to the operator. Each method invocation returns a distinct new value, without changing the value of any other {{MLOperand}}.
644644

645645
At inference time, every {{MLOperand}} will be bound to a tensor (the actual data), which are essentially multidimensional arrays. The representation of the tensors is implementation dependent, but it typically includes the array data stored in some buffer (memory) and some metadata describing the array data (such as its shape).
646646

@@ -1603,7 +1603,6 @@ dictionary MLClampOptions {
16031603

16041604
partial interface MLGraphBuilder {
16051605
MLOperand clamp(MLOperand input, optional MLClampOptions options = {});
1606-
MLActivation clamp(optional MLClampOptions options = {});
16071606
};
16081607
</script>
16091608

@@ -1642,14 +1641,6 @@ partial interface MLGraphBuilder {
16421641
</details>
16431642
</div>
16441643

1645-
<details open algorithm>
1646-
<summary>
1647-
To <dfn>check clamp options</dfn> given {{MLClampOptions}} |options|, run the following steps:
1648-
</summary>
1649-
1. If |options|.{{MLClampOptions/minValue}} is greater than |options|.{{MLClampOptions/maxValue}}, then return false.
1650-
1. Return true.
1651-
</details>
1652-
16531644
#### {{MLGraphBuilder/clamp(input, options)}} #### {#api-mlgraphbuilder-clamp-operand-options}
16541645
<div>
16551646
**Arguments:**
@@ -1664,7 +1655,7 @@ partial interface MLGraphBuilder {
16641655
The <dfn method for=MLGraphBuilder>clamp(|input|, |options|)</dfn> method steps are:
16651656
</summary>
16661657
1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}.
1667-
1. If [=checking clamp options=] given |options| returns false, then [=exception/throw=] a {{TypeError}}.
1658+
1. If |options|.{{MLClampOptions/minValue}} is greater than |options|.{{MLClampOptions/maxValue}}, then [=exception/throw=] a {{TypeError}}.
16681659
1. *Make graph connections:*
16691660
1. Let |output| be the result of [=copying an MLOperand=] given |input|.
16701661
1. Let |operator| be an [=operator=] for the "clamp" operation, given |options|.{{MLClampOptions/minValue}} and |options|.{{MLClampOptions/maxValue}}.
@@ -1674,23 +1665,6 @@ partial interface MLGraphBuilder {
16741665
1. Return |output|.
16751666
</details>
16761667

1677-
#### {{MLGraphBuilder/clamp(options)}} #### {#api-mlgraphbuilder-clamp-options}
1678-
<div>
1679-
**Arguments:**
1680-
- *options*: an optional {{MLClampOptions}}. The optional parameters of the operation.
1681-
**Returns:**
1682-
- an {{MLActivation}}. The operator representing the clamp operation.
1683-
</div>
1684-
1685-
<details open algorithm>
1686-
<summary>
1687-
The <dfn method for=MLGraphBuilder>clamp(|options|)</dfn> method steps are:
1688-
</summary>
1689-
1. If [=checking clamp options=] given |options| returns false, then [=exception/throw=] a {{TypeError}}.
1690-
1. Let |op| be the result of [=creating an MLActivation=] given [=this=], "clamp" and |options|.
1691-
1. Return |op|.
1692-
</details>
1693-
16941668
### concat ### {#api-mlgraphbuilder-concat}
16951669
Concatenates the input tensors along a given axis.
16961670
<script type=idl>
@@ -5334,7 +5308,6 @@ the N-D input tensor along the given axis.
53345308
<script type=idl>
53355309
partial interface MLGraphBuilder {
53365310
MLOperand softmax(MLOperand input, unsigned long axis);
5337-
MLActivation softmax(unsigned long axis);
53385311
};
53395312
</script>
53405313

@@ -5382,26 +5355,6 @@ partial interface MLGraphBuilder {
53825355
1. Return |output|.
53835356
</details>
53845357

5385-
#### {{MLGraphBuilder/softmax(axis)}} #### {#api-mlgraphbuilder-softmax-axis}
5386-
<div>
5387-
**Arguments:**
5388-
- None.
5389-
5390-
**Returns:**
5391-
- an {{MLActivation}}. The activation function representing the softmax operation.
5392-
</div>
5393-
5394-
<details open algorithm>
5395-
<summary>
5396-
The <dfn method for=MLGraphBuilder>softmax(|axis|)</dfn> method steps are:
5397-
</summary>
5398-
1. Let |validationSteps| given {{MLOperandDescriptor}} |descriptor| be these steps:
5399-
1. If |axis| is greater than or equal to |descriptor|.{{MLOperandDescriptor/dimensions}}'s [=list/size=], then return false;
5400-
1. Otherwise, return true.
5401-
1. Let |op| be the result of [=creating an MLActivation=] given [=this=], "softmax", «[ "axis" → |axis| ]», and |validationSteps|.
5402-
1. Return |op|.
5403-
</details>
5404-
54055358
### softplus ### {#api-mlgraphbuilder-softplus-method}
54065359
Compute the <a href="https://en.wikipedia.org/wiki/Rectifier_(neural_networks)#Softplus">softplus function</a> of the input tensor. The calculation follows the expression `ln(1 + exp(x))`.
54075360
<script type=idl>

0 commit comments

Comments
 (0)