diff --git a/index.bs b/index.bs index 8552a769..a4536eea 100644 --- a/index.bs +++ b/index.bs @@ -640,7 +640,7 @@ The {{MLGraphBuilder}} interface serves as a builder (factory) to construct a [= In WebNN, a [=computational graph=] is composed of operators 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 input values for inference, constants (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 input is one or more {{MLOperand}}s. An [=operator=]'s output is one or more {{MLOperand}}s. [=Operators=] have operator-specific parameters that control their behavior, which can include zero or more activation functions, which are {{MLActivation}}s. -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}}. +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}}. 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). @@ -1603,7 +1603,6 @@ dictionary MLClampOptions { partial interface MLGraphBuilder { MLOperand clamp(MLOperand input, optional MLClampOptions options = {}); - MLActivation clamp(optional MLClampOptions options = {}); }; @@ -1642,14 +1641,6 @@ partial interface MLGraphBuilder { -
- - To check clamp options given {{MLClampOptions}} |options|, run the following steps: - - 1. If |options|.{{MLClampOptions/minValue}} is greater than |options|.{{MLClampOptions/maxValue}}, then return false. - 1. Return true. -
- #### {{MLGraphBuilder/clamp(input, options)}} #### {#api-mlgraphbuilder-clamp-operand-options}
**Arguments:** @@ -1664,7 +1655,7 @@ partial interface MLGraphBuilder { The clamp(|input|, |options|) method steps are: 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If [=checking clamp options=] given |options| returns false, then [=exception/throw=] a {{TypeError}}. + 1. If |options|.{{MLClampOptions/minValue}} is greater than |options|.{{MLClampOptions/maxValue}}, then [=exception/throw=] a {{TypeError}}. 1. *Make graph connections:* 1. Let |output| be the result of [=copying an MLOperand=] given |input|. 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 { 1. Return |output|. -#### {{MLGraphBuilder/clamp(options)}} #### {#api-mlgraphbuilder-clamp-options} -
- **Arguments:** - - *options*: an optional {{MLClampOptions}}. The optional parameters of the operation. - **Returns:** - - an {{MLActivation}}. The operator representing the clamp operation. -
- -
- - The clamp(|options|) method steps are: - - 1. If [=checking clamp options=] given |options| returns false, then [=exception/throw=] a {{TypeError}}. - 1. Let |op| be the result of [=creating an MLActivation=] given [=this=], "clamp" and |options|. - 1. Return |op|. -
- ### concat ### {#api-mlgraphbuilder-concat} Concatenates the input tensors along a given axis. @@ -5382,26 +5355,6 @@ partial interface MLGraphBuilder { 1. Return |output|. -#### {{MLGraphBuilder/softmax(axis)}} #### {#api-mlgraphbuilder-softmax-axis} -
- **Arguments:** - - None. - - **Returns:** - - an {{MLActivation}}. The activation function representing the softmax operation. -
- -
- - The softmax(|axis|) method steps are: - - 1. Let |validationSteps| given {{MLOperandDescriptor}} |descriptor| be these steps: - 1. If |axis| is greater than or equal to |descriptor|.{{MLOperandDescriptor/dimensions}}'s [=list/size=], then return false; - 1. Otherwise, return true. - 1. Let |op| be the result of [=creating an MLActivation=] given [=this=], "softmax", «[ "axis" → |axis| ]», and |validationSteps|. - 1. Return |op|. -
- ### softplus ### {#api-mlgraphbuilder-softplus-method} Compute the softplus function of the input tensor. The calculation follows the expression `ln(1 + exp(x))`.