diff --git a/index.bs b/index.bs index b7e8a253..55ee8adb 100644 --- a/index.bs +++ b/index.bs @@ -2921,7 +2921,6 @@ partial dictionary MLOpSupportLimits { ### cumulativeSum ### {#api-mlgraphbuilder-cumulativesum} -!!! Compute the accumulated sum of a series of values along the given axis, either including or excluding the current value. - +
@@ -3307,12 +3306,12 @@ partial dictionary MLOpSupportLimits { - *lesserOrEqual*: Compare if the values of the first input tensor is lesser or equal, element-wise. - *logicalNot*: Invert the values of the input tensor to values 0 or 1, element-wise. Specifically, when the input value is non-zero, invert it to 0. Conversely, for a zero input value, invert it to 1. - *logicalAnd*: Compute the logical *and* operator, element-wise, treating any non-zero value as true and returning elements of 0 or 1. - - *logicalOr*: Compute the logical *and* operator, element-wise, treating any non-zero value as true and returning elements of 0 or 1. - - *logicalXor*: Compute the logical *and* operator, element-wise, treating any non-zero value as true and returning elements of 0 or 1. + - *logicalOr*: Compute the logical *or* operator, element-wise, treating any non-zero value as true and returning elements of 0 or 1. + - *logicalXor*: Compute the logical *xor* operator, element-wise, treating any non-zero value as true and returning elements of 0 or 1.
-Although operations {{MLGraphBuilder/greaterOrEqual()}} and {{MLGraphBuilder/lesserOrEqual()}} can each be implemented in terms of operations {{MLGraphBuilder/logicalNot()}}, {{MLGraphBuilder/lesser()}}, and {{MLGraphBuilder/greater()}} in other words `builder.greaterOrEqual(a, b)` is `builder.logicalNot(builder.lesser(a, b))`, they are specifically defined to handle NaN cases and for performance reason to avoid double comparisons. +Although operations {{MLGraphBuilder/greaterOrEqual()}} and {{MLGraphBuilder/lesserOrEqual()}} can each be implemented in terms of operations {{MLGraphBuilder/logicalNot()}}, {{MLGraphBuilder/lesser()}}, and {{MLGraphBuilder/greater()}} (in other words `builder.greaterOrEqual(a, b)` is `builder.logicalNot(builder.lesser(a, b))`), they are specifically defined to handle NaN cases and for performance reason to avoid double comparisons.
@@ -3678,10 +3677,9 @@ partial dictionary MLOpSupportLimits { ### dequantizeLinear ### {#api-mlgraphbuilder-dequantizelinear} -!!! -Dequantizes an integer tensor to floating point space using the scale and zero-point bias. +Dequantizes an integer tensor to floating point space using the scale and zero-point bias, where `output = (input - zeroPoint) * scale`. -The operation will be [=broadcast=] according to [[!numpy-broadcasting-rule]]. The input tensors must be [=bidirectionally broadcastable=]. The [=MLOperand/rank=] of the output tensor is the maximum [=MLOperand/rank=] of the input tensors. For each dimension of the output tensor, its size is the maximum size along that dimension of the input tensors. +The operation will be [=broadcast=] according to [[!numpy-broadcasting-rule]]. The input tensors must be [=bidirectionally broadcastable=]. The [=MLOperand/rank=] of the output tensor is the maximum [=MLOperand/rank=] of the input tensors. For each dimension of the output tensor, its size is the maximum size along that dimension of the input tensors, and each dimension must be blockwise compatible with the output (e.g. given an input shape [12], scales of the following shapes are blockwise compatible {[1], [3], [4], [6], [12]} as they are all multiples of the input dimensions, but a shape of [5] would not be). -
+
**Arguments:** - input: an {{MLOperand}}. The condition tensor. - - scale: an {{MLOperand}}. !!! - - zeroPoint: an {{MLOperand}}. !!! + - scale: an {{MLOperand}}. The scale tensor to multiply each input value by after adjusting by the zero point. + - zeroPoint: an {{MLOperand}}. The zero point tensor to subtract from each input value. - options: an {{MLOperatorOptions}}. Specifies the optional parameters of the operation. - **Returns:** an {{MLOperand}}. The output tensor that contains the values selected element-wise from ------. + **Returns:** an {{MLOperand}}. The output tensor that contains the values computed from the quantization.
{{MLQuantizationSupportLimits}} has the following members: @@ -3830,24 +3806,11 @@ partial dictionary MLOpSupportLimits {
- The quantizeLinear(|input|, |scale|, |zeroPoint|, |options|) method steps are: + The where(|input|, |scale|, |zeroPoint|, |options|) method steps are: 1. If [=this=].{{MLGraphBuilder/[[hasBuilt]]}} is true, then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. - 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |condition|, |trueValue|, and |falseValue| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |condition|'s [=MLOperand/dataType=] is not equal to {{MLOperandDataType/"uint8"}}, then [=exception/throw=] a {{TypeError}}. - 1. If |trueValue|'s [=MLOperand/dataType=] is not equal to |falseValue|'s [=MLOperand/dataType=], then [=exception/throw=] a {{TypeError}}. - 1. Let |outputShape| be the result of [=bidirectionally broadcasting=] |trueValue|'s [=MLOperand/shape=] and |falseValue|'s [=MLOperand/shape=]. - 1. If that returns failure, then [=exception/throw=] a {{TypeError}}. - 1. Set |outputShape| to the result of [=bidirectionally broadcasting=] |condition|'s [=MLOperand/shape=] and |outputShape]. - 1. If that returns failure, then [=exception/throw=] a {{TypeError}}. - 1. Let |descriptor| be the result of [=creating an MLOperandDescriptor=] given |trueValue|'s [=MLOperand/dataType=] and |outputShape|. - 1. *Make graph connections:* - 1. Let |output| be the result of [=creating an MLOperand=] given [=this=] and |descriptor|. - 1. Let |operator| be an [=operator=] for the "where" operation, given |condition|, |trueValue|, |falseValue|, and |options|. - 1. Set |output|.{{MLOperand/[[operator]]}} to |operator|. - 1. Set |operator|'s [=operator/inputs=] to |condition|, |trueValue| and |falseValue|. - 1. Set |operator|'s [=operator/output=] to |output|. - 1. Return |output|. + 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |scale|, and |zeroPoint| returns false, then [=exception/throw=] a {{TypeError}}. + TODO: Add validation for scale and zero point shape.
@@ -3856,14 +3819,7 @@ partial dictionary MLOpSupportLimits { The behavior of this operation can be [EMULATED]
-    ------
-    function where(builder, condition, trueValue, falseValue) {
-      const c = builder.clamp(condition, {'minValue': 0, 'maxValue': 1});
-      builder.add(
-        builder.mul(trueValue, builder.cast(c, trueValue.dataType)),
-        builder.mul(
-          falseValue, builder.cast(builder.logicalNot(c), falseValue.dataType)));
-    }
+    TODO:
     
@@ -4214,7 +4170,6 @@ partial dictionary MLOpSupportLimits { ### gatherElements ### {#api-mlgraphbuilder-gatherelements} -!!! Gather values of the input tensor along an axis according to the indices. {{MLLayerNormalizationOptions}} has the following members: -
+
: axes :: The indices to the input dimensions to reverse. When this member is not present, it is treated as if all dimensions are reversed. If explicitly passed as empty, no dimensions are reversed. @@ -7985,7 +7874,6 @@ partial dictionary MLOpSupportLimits { ### scatterElements ### {#api-mlgraphbuilder-scatterelements} -!!! Scatter values of the input tensor along an axis according to the indices.
Constraints for {{MLGraphBuilder/cumulativeSum()}}