diff --git a/index.bs b/index.bs index b8846ea8..92e0551d 100644 --- a/index.bs +++ b/index.bs @@ -3544,6 +3544,8 @@ partial interface MLGraphBuilder { MLOperand logicalXor(MLOperand a, MLOperand b, optional MLOperatorOptions options = {}); + MLOperand isNaN(MLOperand a, optional MLOperatorOptions options = {}); + MLOperand isInfinite(MLOperand a, optional MLOperatorOptions options = {}); }; dictionary MLLogicalNotSupportLimits { @@ -3562,10 +3564,12 @@ partial dictionary MLOpSupportLimits { MLBinarySupportLimits logicalAnd; MLBinarySupportLimits logicalOr; MLBinarySupportLimits logicalXor; + MLLogicalNotSupportLimits isNaN; + MLLogicalNotSupportLimits isInfinite; }; -
+
**Arguments:** - a: an {{MLOperand}}. The first input tensor. - b: an {{MLOperand}}. The second input tensor when specified. @@ -3574,7 +3578,7 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output tensor that contains the result of element-wise comparison of the two input tensors.
- +
@@ -3631,6 +3635,10 @@ partial dictionary MLOpSupportLimits { :: Support limits for operator {{MLGraphBuilder/logicalOr()}}. : logicalXor :: Support limits for operator {{MLGraphBuilder/logicalXor()}}. + : isNaN + :: Support limits for operator {{MLGraphBuilder/isNaN()}}. + : isInfinite + :: Support limits for operator {{MLGraphBuilder/isInfinite()}}.
@@ -3645,6 +3653,8 @@ partial dictionary MLOpSupportLimits { - *logicalAnd*: Compute the logical *and* of the two input tensors, element-wise, treating any non-zero value as true and returning elements of 0 or 1. - *logicalOr*: Compute the logical *or* of the two input tensors, element-wise, treating any non-zero value as true and returning elements of 0 or 1. - *logicalXor*: Compute the logical *xor* of the two input tensors, element-wise, treating any non-zero value as true and returning elements of 0 or 1. + - *isNaN*: Check if the values of the input tensor are invalid numeric representations (NaN's), element-wise, returning 1's for NaN's and 0 otherwise. + - *isInfinite*: Check if the values of the input tensor are infinite, element-wise, returning 1's for positive or negative infinity and 0 otherwise.
@@ -3655,11 +3665,13 @@ Although operations {{MLGraphBuilder/greaterOrEqual()}} and {{MLGraphBuilder/les To create an element-wise logical operation given [=string=] |op|, {{MLOperand}} |a|, an optional {{MLOperand}} |b|, and {{MLOperatorOptions}} |options|, run the following steps: - 1. [=Assert=]: |op| is one of "equal", "notEqual", "greater", "greaterOrEqual", "lesser", "lesserOrEqual", "logicalNot", "logicalAnd", "logicalOr", "logicalXor". + 1. [=Assert=]: |op| is one of "equal", "notEqual", "greater", "greaterOrEqual", "lesser", "lesserOrEqual", "logicalNot", "logicalAnd", "logicalOr", "logicalXor", "isNaN", "isInfinite". 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |a| returns false, then [=exception/throw=] a {{TypeError}}. 1. If |op| is one of "logicalNot", "logicalAnd", "logicalOr", "logicalXor", then: 1. If |a|'s [=MLOperand/dataType=] is not {{MLOperandDataType/"uint8"}}, then [=exception/throw=] a {{TypeError}}. + 1. If |op| is one of "isNaN", "isInfinite", then: + 1. If |a|'s [=MLOperand/dataType=] is not one of « {{MLOperandDataType/"float32"}}, {{MLOperandDataType/"float16"}} », then [=exception/throw=] a {{TypeError}}. 1. If |b| is passed, then: 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |b| returns false, then [=exception/throw=] a {{TypeError}}. 1. If |a|'s [=MLOperand/dataType=] is not equal to |b|'s [=MLOperand/dataType=], then [=exception/throw=] a {{TypeError}}. @@ -3749,6 +3761,20 @@ Although operations {{MLGraphBuilder/greaterOrEqual()}} and {{MLGraphBuilder/les 1. If that [=exception/throws=] an error, then re-[=exception/throw=] the error. 1. Return |output|.
+ +
+ The isNaN(|a|, |options|) method steps are: + 1. Let |output| be the result of [=MLGraphBuilder/element-wise-logical-op|creating an element-wise logical operation=] given "isNaN", |a|, and |options|. + 1. If that [=exception/throws=] an error, then re-[=exception/throw=] the error. + 1. Return |output|. +
+ +
+ The isInfinite(|a|, |options|) method steps are: + 1. Let |output| be the result of [=MLGraphBuilder/element-wise-logical-op|creating an element-wise logical operation=] given "isInfinite", |a|, and |options|. + 1. If that [=exception/throws=] an error, then re-[=exception/throw=] the error. + 1. Return |output|. +
### Element-wise unary operations ### {#api-mlgraphbuilder-unary}
Constraints for element-wise logical options