From 69b43cde0995e395e4c8c630acdf27f2cab093ee Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Wed, 4 Jun 2025 15:43:37 +0800 Subject: [PATCH 1/5] Support rankRange for output tensors in opSupportLimits Fix #835 --- index.bs | 92 +++++++++++++++++++++++++------------------------------- 1 file changed, 41 insertions(+), 51 deletions(-) diff --git a/index.bs b/index.bs index c4cd7a24..1cbf10e6 100644 --- a/index.bs +++ b/index.bs @@ -1426,9 +1426,9 @@ The {{MLOpSupportLimits}} has the following top level members, aside from these, dictionary MLOpSupportLimits { MLInputOperandLayout preferredInputLayout; [EnforceRange] unsigned long long maxTensorByteLength; - MLDataTypeLimits input; - MLDataTypeLimits constant; - MLDataTypeLimits output; + MLTensorLimits input; + MLTensorLimits constant; + MLTensorLimits output; }; @@ -1444,18 +1444,6 @@ dictionary MLOpSupportLimits { : output :: Support limits for output {{MLOperand}}s for an {{MLGraph}}. -#### {{MLDataTypeLimits}} dictionary #### {#api-mlcontext-datatypelimits-dictionary} - -
- : dataTypes - :: Supported data types. -
#### {{MLRankRange}} dictionary #### {#api-mlcontext-rankrange-dictionary} @@ -1500,14 +1490,14 @@ dictionary MLBinarySupportLimits { : b :: {{MLTensorLimits}} for b operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. #### {{MLSingleInputSupportLimits}} dictionary #### {#api-mlcontext-singleinputsupportlimits-dictionary} @@ -1515,7 +1505,7 @@ dictionary MLSingleInputSupportLimits { : input :: {{MLTensorLimits}} for input operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. ### {{MLContext/destroy()}} ### {#api-mlcontext-destroy} @@ -1759,7 +1749,7 @@ Since the {{MLOperand/[[builder]]}} object is bound by the {{MLGraphBuilder/cons If an operation supports only a subset of {{MLOperandDataType}}s, the allowed data types for each of the operation's input operands, including both positional arguments and options, are given as either an explicit list of {{MLOperandDataType}}s, or a constraint that the operand's [=MLOperand/dataType=] must be the same as the [=MLOperand/dataType=] of another input operand, or any to allow any {{MLOperandDataType}}. -Implementations may support fewer data types for operands than specified. This can be queried for each operation using the {{MLContext/opSupportLimits()}} method on {{MLContext}} and inspecting the {{MLDataTypeLimits/dataTypes}} value of the corresponding member for the operation. +Implementations may support fewer data types for operands than specified. This can be queried for each operation using the {{MLContext/opSupportLimits()}} method on {{MLContext}} and inspecting the {{MLTensorLimits/dataTypes}} value of the corresponding member for the operation. Issue: Should we specify the subset of data types that must be supported for each operator? @@ -2325,7 +2315,7 @@ dictionary MLBatchNormalizationSupportLimits { MLTensorLimits variance; MLTensorLimits scale; MLTensorLimits bias; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -2726,7 +2716,7 @@ partial interface MLGraphBuilder { dictionary MLConcatSupportLimits { MLTensorLimits inputs; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -2772,7 +2762,7 @@ partial dictionary MLOpSupportLimits { : inputs :: {{MLTensorLimits}} for all input operands. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/concat()}}: @@ -2844,7 +2834,7 @@ dictionary MLConv2dSupportLimits { MLTensorLimits input; MLTensorLimits filter; MLTensorLimits bias; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -2951,7 +2941,7 @@ partial dictionary MLOpSupportLimits { : bias :: {{MLTensorLimits}} for bias operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/conv2d()}}: @@ -3572,7 +3562,7 @@ partial interface MLGraphBuilder { dictionary MLLogicalNotSupportLimits { MLTensorLimits a; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -3632,7 +3622,7 @@ partial dictionary MLOpSupportLimits { : a :: {{MLTensorLimits}} for a operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following members for element-wise logical operations: @@ -4087,7 +4077,7 @@ dictionary MLQuantizeDequantizeLinearSupportLimits { MLTensorLimits input; MLTensorLimits scale; MLTensorLimits zeroPoint; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -4145,7 +4135,7 @@ partial dictionary MLOpSupportLimits { : zeroPoint :: {{MLTensorLimits}} for zeroPoint operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/dequantizeLinear()}}: @@ -4544,7 +4534,7 @@ partial interface MLGraphBuilder { dictionary MLGatherSupportLimits { MLTensorLimits input; MLTensorLimits indices; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -4605,7 +4595,7 @@ partial dictionary MLOpSupportLimits { : indices :: {{MLTensorLimits}} for indices operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/gather()}}: @@ -5172,7 +5162,7 @@ dictionary MLGemmSupportLimits { MLTensorLimits a; MLTensorLimits b; MLTensorLimits c; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -5252,7 +5242,7 @@ partial dictionary MLOpSupportLimits { : c :: {{MLTensorLimits}} for c operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/gemm()}}: @@ -5363,7 +5353,7 @@ dictionary MLGruSupportLimits { MLTensorLimits bias; MLTensorLimits recurrentBias; MLTensorLimits initialHiddenState; - MLDataTypeLimits outputs; + MLTensorLimits outputs; }; partial dictionary MLOpSupportLimits { @@ -5485,7 +5475,7 @@ partial dictionary MLOpSupportLimits { : initialHiddenState :: {{MLTensorLimits}} for initialHiddenState operand. : outputs - :: {{MLDataTypeLimits}} for all the output operands. + :: {{MLTensorLimits}} for all the output operands. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/gru()}}: @@ -5704,7 +5694,7 @@ dictionary MLGruCellSupportLimits { MLTensorLimits hiddenState; MLTensorLimits bias; MLTensorLimits recurrentBias; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -5803,7 +5793,7 @@ partial dictionary MLOpSupportLimits { : recurrentBias :: {{MLTensorLimits}} for recurrentBias operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/gruCell()}}: @@ -6163,7 +6153,7 @@ dictionary MLNormalizationSupportLimits { MLTensorLimits input; MLTensorLimits scale; MLTensorLimits bias; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -6239,7 +6229,7 @@ partial dictionary MLOpSupportLimits { : bias :: {{MLTensorLimits}} for bias operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/instanceNormalization()}}: @@ -6684,7 +6674,7 @@ dictionary MLLstmSupportLimits { MLTensorLimits peepholeWeight; MLTensorLimits initialHiddenState; MLTensorLimits initialCellState; - MLDataTypeLimits outputs; + MLTensorLimits outputs; }; partial dictionary MLOpSupportLimits { @@ -6829,7 +6819,7 @@ partial dictionary MLOpSupportLimits { : initialCellState :: {{MLTensorLimits}} for initialCellState operand. : outputs - :: {{MLDataTypeLimits}} for all the output operands. + :: {{MLTensorLimits}} for all the output operands. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/lstm()}}: @@ -7093,7 +7083,7 @@ dictionary MLLstmCellSupportLimits { MLTensorLimits bias; MLTensorLimits recurrentBias; MLTensorLimits peepholeWeight; - MLDataTypeLimits outputs; + MLTensorLimits outputs; }; partial dictionary MLOpSupportLimits { @@ -7217,7 +7207,7 @@ partial dictionary MLOpSupportLimits { : peepholeWeight :: {{MLTensorLimits}} for peepholeWeight operand. : outputs - :: {{MLDataTypeLimits}} for all the output operands. + :: {{MLTensorLimits}} for all the output operands. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/lstmCell()}}: @@ -7898,7 +7888,7 @@ partial interface MLGraphBuilder { dictionary MLPreluSupportLimits { MLTensorLimits input; MLTensorLimits slope; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -7948,7 +7938,7 @@ partial dictionary MLOpSupportLimits { : slope :: {{MLTensorLimits}} for slope operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/prelu()}}: @@ -8679,7 +8669,7 @@ dictionary MLScatterSupportLimits { MLTensorLimits input; MLTensorLimits indices; MLTensorLimits updates; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -8744,7 +8734,7 @@ partial dictionary MLOpSupportLimits { : updates :: {{MLTensorLimits}} for updates operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/scatterElements()}}: @@ -9551,7 +9541,7 @@ partial interface MLGraphBuilder { dictionary MLSplitSupportLimits { MLTensorLimits input; - MLDataTypeLimits outputs; + MLTensorLimits outputs; }; partial dictionary MLOpSupportLimits { @@ -9601,7 +9591,7 @@ partial dictionary MLOpSupportLimits { : input :: {{MLTensorLimits}} for input operand. : outputs - :: {{MLDataTypeLimits}} for all the output operands. + :: {{MLTensorLimits}} for all the output operands. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/split()}}: @@ -10067,7 +10057,7 @@ dictionary MLWhereSupportLimits { MLTensorLimits condition; MLTensorLimits trueValue; MLTensorLimits falseValue; - MLDataTypeLimits output; + MLTensorLimits output; }; partial dictionary MLOpSupportLimits { @@ -10125,7 +10115,7 @@ partial dictionary MLOpSupportLimits { : falseValue :: {{MLTensorLimits}} for falseValue operand. : output - :: {{MLDataTypeLimits}} for output operand. + :: {{MLTensorLimits}} for output operand. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/where()}}: From 356febd346807e49bdc5e9a8eafade00c9f4efa2 Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Tue, 2 Sep 2025 16:42:53 +0800 Subject: [PATCH 2/5] Additional change of output tensor rank 1. Add allowed ranks for all lstm and gru output tensors. 2. Validate new shape's rank of expand and reshape operations. 3. Simplify allowed ranks for some operations based on implementation experience. 4. Other minor changes for consistency. --- index.bs | 70 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/index.bs b/index.bs index 1cbf10e6..d3c78dcf 100644 --- a/index.bs +++ b/index.bs @@ -2241,8 +2241,8 @@ partial dictionary MLOpSupportLimits { *output* - {{MLArgMinMaxOptions/outputDataType}} - {{input}}'s [=MLOperand/rank=] - 1 to {{input}}'s [=MLOperand/rank=] + {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"int64"}} + [=/any rank|N=] @@ -2506,7 +2506,7 @@ partial dictionary MLOpSupportLimits { *output* - {{dataType}} + [=/any data type|any=] [=/same rank as|same as=] {{input}} @@ -3425,7 +3425,7 @@ partial dictionary MLOpSupportLimits { *output* [=/same type as|same as=] {{a}} - maximum of {{a}}'s [=MLOperand/rank=] and {{b}}'s [=MLOperand/rank=] + [=/any rank|N=] @@ -3612,7 +3612,7 @@ partial dictionary MLOpSupportLimits { *output* {{MLOperandDataType/"uint8"}} - maximum of {{a}}'s [=MLOperand/rank=] and {{b}}'s [=MLOperand/rank=] + [=/any rank|N=] @@ -4490,7 +4490,7 @@ partial dictionary MLOpSupportLimits { *output* [=/same type as|same as=] {{input}} - {{newShape}}'s [=list/size=] + [=/any rank|N=] @@ -4508,6 +4508,7 @@ partial dictionary MLOpSupportLimits { 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. 1. Let |outputShape| be the result of [=unidirectionally broadcasting=] |input|'s [=MLOperand/shape=] and |newShape|. 1. If that returns failure, then [=exception/throw=] a {{TypeError}}. + 1. If |outputShape|'s [=list/size=] is not output tensor's [=/allowed ranks=] (according to [this table](#constraints-expand)), then [=exception/throw=] a {{TypeError}}. 1. Let |outputDescriptor| be the result of [=creating an MLOperandDescriptor=] given |input|'s [=MLOperand/dataType=] and |outputShape|. 1. *Make graph connections:* 1. Let |output| be the result of [=creating an MLOperand=] given [=this=] and |outputDescriptor|. @@ -4584,7 +4585,7 @@ partial dictionary MLOpSupportLimits { *output* [=/same type as|same as=] {{input}} - {{input}}'s [=MLOperand/rank=] + {{indices}}'s [=MLOperand/rank=] - 1 + [=/any rank|N=] @@ -4911,7 +4912,7 @@ partial dictionary MLOpSupportLimits { *output* [=/same type as|same as=] {{input}} - {{input}}'s [=MLOperand/rank=] + {{indices}}'s [=MLOperand/rank=] - {{indices}}'s [=MLOperand/shape=][-1] - 1 + [=/any rank|N=] @@ -5353,7 +5354,8 @@ dictionary MLGruSupportLimits { MLTensorLimits bias; MLTensorLimits recurrentBias; MLTensorLimits initialHiddenState; - MLTensorLimits outputs; + MLTensorLimits output0; + MLTensorLimits output1; }; partial dictionary MLOpSupportLimits { @@ -5474,8 +5476,10 @@ partial dictionary MLOpSupportLimits { :: {{MLTensorLimits}} for recurrentBias operand. : initialHiddenState :: {{MLTensorLimits}} for initialHiddenState operand. - : outputs - :: {{MLTensorLimits}} for all the output operands. + : output0 + :: {{MLTensorLimits}} for all the output operands[0]. + : output1 + :: {{MLTensorLimits}} for all the output operands[1]. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/gru()}}: @@ -6359,12 +6363,12 @@ partial dictionary MLOpSupportLimits { {{MLLayerNormalizationOptions/scale}} [=/same type as|same as=] {{input}} - 0 to {{input}}'s [=MLOperand/rank=] + [=/any rank|N=] {{MLLayerNormalizationOptions/bias}} [=/same type as|same as=] {{input}} - 0 to {{input}}'s [=MLOperand/rank=] + [=/any rank|N=] *output* @@ -6674,7 +6678,9 @@ dictionary MLLstmSupportLimits { MLTensorLimits peepholeWeight; MLTensorLimits initialHiddenState; MLTensorLimits initialCellState; - MLTensorLimits outputs; + MLTensorLimits output0; + MLTensorLimits output1; + MLTensorLimits output2; }; partial dictionary MLOpSupportLimits { @@ -6818,8 +6824,12 @@ partial dictionary MLOpSupportLimits { :: {{MLTensorLimits}} for initialHiddenState operand. : initialCellState :: {{MLTensorLimits}} for initialCellState operand. - : outputs - :: {{MLTensorLimits}} for all the output operands. + : output0 + :: {{MLTensorLimits}} for all the output operands[0]. + : output1 + :: {{MLTensorLimits}} for all the output operands[1]. + : output2 + :: {{MLTensorLimits}} for all the output operands[2]. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/lstm()}}: @@ -7083,7 +7093,8 @@ dictionary MLLstmCellSupportLimits { MLTensorLimits bias; MLTensorLimits recurrentBias; MLTensorLimits peepholeWeight; - MLTensorLimits outputs; + MLTensorLimits output0; + MLTensorLimits output1; }; partial dictionary MLOpSupportLimits { @@ -7206,8 +7217,10 @@ partial dictionary MLOpSupportLimits { :: {{MLTensorLimits}} for recurrentBias operand. : peepholeWeight :: {{MLTensorLimits}} for peepholeWeight operand. - : outputs - :: {{MLTensorLimits}} for all the output operands. + : output0 + :: {{MLTensorLimits}} for all the output operands[0]. + : output1 + :: {{MLTensorLimits}} for all the output operands[1]. {{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/lstmCell()}}: @@ -7433,17 +7446,17 @@ partial dictionary MLOpSupportLimits { {{a}} {{MLOperandDataType/"float32"}}, {{MLOperandDataType/"float16"}} - 2 or greater + 2 to [=/any rank|N=] {{b}} [=/same type as|same as=] {{a}} - 2 or greater + 2 or [=/any rank|N=] *output* [=/same type as|same as=] {{a}} - maximum of {{a}}'s [=MLOperand/rank=] and {{b}}'s [=MLOperand/rank=] + 2 or [=/any rank|N=] @@ -7927,7 +7940,7 @@ partial dictionary MLOpSupportLimits { *output* [=/same type as|same as=] {{input}} - maximum of {{input}}'s [=MLOperand/rank=] and {{slope}}'s [=MLOperand/rank=] + [=/any rank|N=] @@ -8060,7 +8073,7 @@ partial dictionary MLOpSupportLimits { *output* [=/same type as|same as=] {{input}} - 0 to {{input}}'s [=MLOperand/rank=], depending on {{MLReduceOptions/axes}} and {{MLReduceOptions/keepDimensions}} + [=/any rank|N=] @@ -8539,7 +8552,7 @@ partial dictionary MLOpSupportLimits { *output* [=/same type as|same as=] {{input}} - {{newShape}}'s [=list/size=] + [=/any rank|N=] @@ -8555,6 +8568,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. + 1. If |newShape|'s [=list/size=] is not output tensor's [=/allowed ranks=] (according to [this table](#constraints-reshape)), then [=exception/throw=] a {{TypeError}}. 1. Let |outputShape| be an empty array of {{unsigned long}}. 1. If |newShape|'s [=list/size=] is 0, then set |outputShape| to an empty [=/list=] for a scalar. 1. If any [=list/item=] in |newShape| is not a [=valid dimension=], then [=exception/throw=] a {{TypeError}}. @@ -8929,7 +8943,7 @@ partial dictionary MLOpSupportLimits { {{updates}} [=/same type as|same as=] {{input}} - {{input}}'s [=MLOperand/rank=] + {{indices}}'s [=MLOperand/rank=] - {{indices}}'s [=MLOperand/shape=][-1] - 1 + [=/any rank|N=] *output* @@ -9947,7 +9961,7 @@ partial dictionary MLOpSupportLimits { {{input}} [=/any data type|any=] - 2 or greater + 2 to [=/any rank|N=] *output* @@ -10102,7 +10116,7 @@ partial dictionary MLOpSupportLimits { *output* [=/same type as|same as=] {{trueValue}} - maximum of {{condition}}'s [=MLOperand/rank=], {{trueValue}}'s [=MLOperand/rank=] and {{falseValue}}'s [=MLOperand/rank=] + [=/any rank|N=] From e4c5a4304c6a76ab14508f245df8033600d7b490 Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Mon, 15 Sep 2025 18:02:00 +0800 Subject: [PATCH 3/5] Validate output data type for argMin/argMax and cast --- index.bs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.bs b/index.bs index d3c78dcf..51decb6c 100644 --- a/index.bs +++ b/index.bs @@ -2262,6 +2262,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. 1. If |axis| is greater than or equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}. + 1. if |options|.{{MLArgMinMaxOptions/outputDataType}} is not output tensor's [=/allowed data types=] (according to [this table](#constraints-argMin-argMax)), then [=exception/throw=] a {{TypeError}}. 1. If |input|'s [=MLOperand/shape=][|axis|] is greater than |options|.{{MLArgMinMaxOptions/outputDataType}}'s maximum value, then [=exception/throw=] a {{TypeError}}. 1. Let |outputShape| be the result of [=MLGraphBuilder/calculating reduction output sizes=] given |input|'s [=MLOperand/shape=], « |axis| », and |options|.{{MLArgMinMaxOptions/keepDimensions}}. If that returns failure, then [=exception/throw=] a {{TypeError}}. 1. Let |desc| be the result of [=creating an MLOperandDescriptor=] given |options|.{{MLArgMinMaxOptions/outputDataType}} and |outputShape|. @@ -2587,6 +2588,7 @@ NOTE: For example, casting -1 from {{MLOperandDataType/"int8"}} to {{MLOperandDa 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. + 1. if |dataType| is not output tensor's [=/allowed data types=] (according to [this table](#constraints-cast)), then [=exception/throw=] a {{TypeError}}. 1. *Make graph connections:* 1. Let |operator| be an [=operator=] for the "cast" operation, given |dataType| and |options|. 1. Let |output| be the result of [=copying an MLOperand=] given |input|. From 1a4d2fb3cf0f38fa51c839e1059f25c807451c84 Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Tue, 16 Sep 2025 20:06:53 +0800 Subject: [PATCH 4/5] Argument output tensor description with rank range Move the output tensor rank range info from constraints table to Returns section for argMin/Max and reduction ops. The element-wise binary and logical ops, matmul and where ops already have such info in the Returns section. Fix issues of output rank description of prelu and scatterND. --- index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 51decb6c..f2f9ea13 100644 --- a/index.bs +++ b/index.bs @@ -2222,7 +2222,7 @@ partial dictionary MLOpSupportLimits { - axis: The dimension to reduce. The value must be in the range [0, N-1] where N is the [=MLOperand/rank=] of the input tensor. - options: an optional {{MLArgMinMaxOptions}}. The optional parameters of the operation. - **Returns:** an {{MLOperand}}. The N-D tensor of the reduced shape. The values must be of type {{MLArgMinMaxOptions/outputDataType}} in the range [0, N-1] where N is the size of the input dimension specified by {{MLGraphBuilder/argMin(input, axis, options)/axis}}. + **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to {{MLGraphBuilder/argMin(input, axis, options)/input}}'s [=MLOperand/rank=] if {{MLArgMinMaxOptions/keepDimensions}} is true or the {{MLGraphBuilder/argMin(input, axis, options)/input}}'s [=MLOperand/rank=] - 1 if {{MLArgMinMaxOptions/keepDimensions}} is false. The values must be of type {{MLArgMinMaxOptions/outputDataType}} in the range [0, N-1] where N is the size of the input dimension specified by {{MLGraphBuilder/argMin(input, axis, options)/axis}}. @@ -7918,7 +7918,7 @@ partial dictionary MLOpSupportLimits { - options: an {{MLOperatorOptions}}. Specifies the optional parameters of the operation. **Returns:** - - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/prelu(input, slope, options)/input}}. + - an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to the maximum of {{MLGraphBuilder/prelu(input, slope, options)/input}}'s [=MLOperand/rank=] and {{MLGraphBuilder/prelu(input, slope, options)/slope}}'s [=MLOperand/rank=].
@@ -8055,7 +8055,7 @@ partial dictionary MLOpSupportLimits { - input: an {{MLOperand}}. The input tensor. - options: an optional {{MLReduceOptions}}. The optional parameters of the operation. - **Returns:** an {{MLOperand}}. The reduced output tensor. If the input operand is a scalar, the reduction function is applied to the scalar value, and the output is also a scalar. + **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] in the range 0 to {{MLGraphBuilder/reduceL1(input, options)/input}}'s [=MLOperand/rank=], inclusive, depending on {{MLReduceOptions/axes}} and {{MLReduceOptions/keepDimensions}}. If the input operand is a scalar, the reduction function is applied to the scalar value, and the output is also a scalar.
@@ -8920,7 +8920,7 @@ partial dictionary MLOpSupportLimits { - updates: an {{MLOperand}}. New values to replace atop the input. - options: an optional {{MLScatterOptions}}. The optional parameters of the operation. - **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to the [=MLOperand/rank=] of {{MLGraphBuilder/scatterND(input, indices, updates, options)/input}}'s [=MLOperand/rank=] + {{MLGraphBuilder/scatterND(input, indices, updates, options)/indices}}'s [=MLOperand/rank=] - {{MLGraphBuilder/scatterND(input, indices, updates, options)/indices}}'s [=MLOperand/shape=][-1] - 1. + **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to {{MLGraphBuilder/scatterND(input, indices, updates, options)/input}}'s [=MLOperand/rank=] + {{MLGraphBuilder/scatterND(input, indices, updates, options)/indices}}'s [=MLOperand/rank=] - {{MLGraphBuilder/scatterND(input, indices, updates, options)/indices}}'s [=MLOperand/shape=][-1] - 1.
From ad2f04b50f522c24b5fa9a020a2f6787a754072c Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Tue, 16 Sep 2025 20:29:46 +0800 Subject: [PATCH 5/5] Replace "Constraints for ops" table title with "Tensor limits for ops" --- index.bs | 350 +++++++++++++++++++++++++++---------------------------- 1 file changed, 175 insertions(+), 175 deletions(-) diff --git a/index.bs b/index.bs index f2f9ea13..e60b1576 100644 --- a/index.bs +++ b/index.bs @@ -2225,8 +2225,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to {{MLGraphBuilder/argMin(input, axis, options)/input}}'s [=MLOperand/rank=] if {{MLArgMinMaxOptions/keepDimensions}} is true or the {{MLGraphBuilder/argMin(input, axis, options)/input}}'s [=MLOperand/rank=] - 1 if {{MLArgMinMaxOptions/keepDimensions}} is false. The values must be of type {{MLArgMinMaxOptions/outputDataType}} in the range [0, N-1] where N is the size of the input dimension specified by {{MLGraphBuilder/argMin(input, axis, options)/axis}}. -
- +
Constraints for {{MLGraphBuilder/argMin()}}/{{MLGraphBuilder/argMax()}}
+ @@ -2262,7 +2262,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. 1. If |axis| is greater than or equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}. - 1. if |options|.{{MLArgMinMaxOptions/outputDataType}} is not output tensor's [=/allowed data types=] (according to [this table](#constraints-argMin-argMax)), then [=exception/throw=] a {{TypeError}}. + 1. if |options|.{{MLArgMinMaxOptions/outputDataType}} is not output tensor's [=/allowed data types=] (according to [this table](#tensor-limits-argMin-argMax)), then [=exception/throw=] a {{TypeError}}. 1. If |input|'s [=MLOperand/shape=][|axis|] is greater than |options|.{{MLArgMinMaxOptions/outputDataType}}'s maximum value, then [=exception/throw=] a {{TypeError}}. 1. Let |outputShape| be the result of [=MLGraphBuilder/calculating reduction output sizes=] given |input|'s [=MLOperand/shape=], « |axis| », and |options|.{{MLArgMinMaxOptions/keepDimensions}}. If that returns failure, then [=exception/throw=] a {{TypeError}}. 1. Let |desc| be the result of [=creating an MLOperandDescriptor=] given |options|.{{MLArgMinMaxOptions/outputDataType}} and |outputShape|. @@ -2353,8 +2353,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The batch-normalized N-D tensor of the same shape as {{MLGraphBuilder/batchNormalization(input, mean, variance, options)/input}}. -
Tensor limits for {{MLGraphBuilder/argMin()}}/{{MLGraphBuilder/argMax()}}
operand
- +
Constraints for {{MLGraphBuilder/batchNormalization()}}
+ @@ -2422,18 +2422,18 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |mean|, |variance|, |options|.{{MLBatchNormalizationOptions/scale}} (if it [=map/exists=]), and |options|.{{MLBatchNormalizationOptions/bias}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-batchNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-batchNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLBatchNormalizationOptions/axis}} is not in [=the range=] 0 to |input|'s [=MLOperand/rank=], exclusive, then [=exception/throw=] a {{TypeError}}. - 1. If |mean|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-batchNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If |mean|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-batchNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If |mean|'s [=MLOperand/shape=] is not [=list/equal=] to « |input|'s [=MLOperand/shape=][|options|.{{MLBatchNormalizationOptions/axis}}] », then [=exception/throw=] a {{TypeError}}. - 1. If |variance|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-batchNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If |variance|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-batchNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If |variance|'s [=MLOperand/shape=] is not [=list/equal=] to « |input|'s [=MLOperand/shape=][|options|.{{MLBatchNormalizationOptions/axis}}] », then [=exception/throw=] a {{TypeError}}. 1. Set |options|.{{MLBatchNormalizationOptions/epsilon}} to the result of [=casting=] |options|.{{MLBatchNormalizationOptions/epsilon}} to |input|'s [=MLOperand/dataType=]. 1. If |options|.{{MLBatchNormalizationOptions/scale}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-batchNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-batchNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |input|'s [=MLOperand/shape=][|options|.{{MLBatchNormalizationOptions/axis}}] », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLBatchNormalizationOptions/bias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-batchNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-batchNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |input|'s [=MLOperand/shape=][|options|.{{MLBatchNormalizationOptions/axis}}] », then [=exception/throw=] a {{TypeError}}. 1. *Make graph connections:* 1. Let |operator| be an [=operator=] for the "batchNormalization" operation, given |input|, |mean|, |variance| and |options|. @@ -2491,8 +2491,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The N-D tensor of the same shape as {{MLGraphBuilder/cast(input, dataType, options)/input}} with each element casted to the target data type. -
Tensor limits for {{MLGraphBuilder/batchNormalization()}}
operand
- +
Constraints for {{MLGraphBuilder/cast()}}
+ @@ -2588,7 +2588,7 @@ NOTE: For example, casting -1 from {{MLOperandDataType/"int8"}} to {{MLOperandDa 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. if |dataType| is not output tensor's [=/allowed data types=] (according to [this table](#constraints-cast)), then [=exception/throw=] a {{TypeError}}. + 1. if |dataType| is not output tensor's [=/allowed data types=] (according to [this table](#tensor-limits-cast)), then [=exception/throw=] a {{TypeError}}. 1. *Make graph connections:* 1. Let |operator| be an [=operator=] for the "cast" operation, given |dataType| and |options|. 1. Let |output| be the result of [=copying an MLOperand=] given |input|. @@ -2632,8 +2632,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/clamp(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/cast()}}
operand
- +
Constraints for {{MLGraphBuilder/clamp()}}
+ @@ -2738,8 +2738,8 @@ partial dictionary MLOpSupportLimits { computed as the sum of all the input sizes of the same dimension. -
Tensor limits for {{MLGraphBuilder/clamp()}}
operand
- +
Constraints for {{MLGraphBuilder/concat()}}
+ @@ -2903,8 +2903,8 @@ partial dictionary MLOpSupportLimits { `outputSize = 1 + (inputSize - (filterSize - 1) * dilation - 1 + beginningPadding + endingPadding) / stride` -
Tensor limits for {{MLGraphBuilder/concat()}}
operand
- +
Constraints for {{MLGraphBuilder/conv2d()}}
+ @@ -2981,10 +2981,10 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |filter|, and |options|.{{MLConv2dOptions/bias}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-conv2d)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-conv2d)), then [=exception/throw=] a {{TypeError}}. 1. If |input|'s [=MLOperand/rank=] is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. If |filter|'s [=MLOperand/rank=] is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. - 1. If |filter|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-conv2d)), then [=exception/throw=] a {{TypeError}}. + 1. If |filter|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-conv2d)), then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLConv2dOptions/padding}} does not [=map/exist=], then set it to the [=/list=] « 0, 0, 0, 0 ». 1. Otherwise, if |options|.{{MLConv2dOptions/padding}}'s [=list/size=] is not 4, then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLConv2dOptions/strides}} does not [=map/exist=], then set it to the [=/list=] « 1, 1 ». @@ -3019,7 +3019,7 @@ partial dictionary MLOpSupportLimits { 1. Otherwise, if |inputChannels| / |options|.{{MLConv2dOptions/groups}} is not equal to |filterInputChannels|, then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLConv2dOptions/bias}} [=map/exists=], then: 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |outputChannels| », then [=exception/throw=] a {{TypeError}}. - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-conv2d)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-conv2d)), then [=exception/throw=] a {{TypeError}}. 1. Let « |outputHeight|, |outputWidth| » be the result of [=MLGraphBuilder/calculating conv2d output sizes=] given |inputHeight|, |inputWidth|, |filterHeight|, |filterWidth|, |options|.{{MLConv2dOptions/padding}}, |options|.{{MLConv2dOptions/strides}}, and |options|.{{MLConv2dOptions/dilations}}. 1. Set |outputHeight| to floor( |outputHeight| ). 1. Set |outputWidth| to floor( |outputWidth| ). @@ -3148,8 +3148,8 @@ partial dictionary MLOpSupportLimits { `outputSize = (inputSize - 1) * stride + (filterSize - 1) * dilation + 1 - beginningPadding - endingPadding + outputPadding` -
Tensor limits for {{MLGraphBuilder/conv2d()}}
operand
- +
Constraints for {{MLGraphBuilder/convTranspose2d()}}
+ @@ -3201,9 +3201,9 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |filter|, and |options|.{{MLConvTranspose2dOptions/bias}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. 1. If |input|'s [=MLOperand/rank=] is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-convTranspose2d)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-convTranspose2d)), then [=exception/throw=] a {{TypeError}}. 1. If |filter|'s [=MLOperand/rank=] is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. - 1. If |filter|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-convTranspose2d)), then [=exception/throw=] a {{TypeError}}. + 1. If |filter|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-convTranspose2d)), then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLConvTranspose2dOptions/padding}} does not [=map/exist=], then set it to the [=/list=] « 0, 0, 0, 0 ». 1. Otherwise, if |options|.{{MLConvTranspose2dOptions/padding}}'s [=list/size=] is not 4, then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLConvTranspose2dOptions/strides}} does not [=map/exist=], then set it to the [=/list=] « 1, 1 ». @@ -3243,7 +3243,7 @@ partial dictionary MLOpSupportLimits { 1. If |outputChannels| is not a [=valid dimension=], then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLConvTranspose2dOptions/bias}} [=map/exists=], then: 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |outputChannels| », then [=exception/throw=] a {{TypeError}}. - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-convTranspose2d)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-convTranspose2d)), then [=exception/throw=] a {{TypeError}}. 1. Let |calculatedOutputHeight| be the result of [=MLGraphBuilder/calculating convtranspose output size=] given |inputHeight|, |filterHeight|, |padding|[0], |padding|[1], |strides|[0] and |dilations|[0]. 1. Let |calculatedOutputWidth| be the result of [=MLGraphBuilder/calculating convtranspose output size=] given |inputWidth|, |filterWidth|, |padding|[2], |padding|[3], |strides|[1] and |dilations|[1]. 1. If |options|.{{MLConvTranspose2dOptions/outputSizes}} [=map/exists=], then: @@ -3292,8 +3292,8 @@ partial dictionary MLOpSupportLimits { }; -
Tensor limits for {{MLGraphBuilder/convTranspose2d()}}
operand
- +
Constraints for {{MLGraphBuilder/cumulativeSum()}}
+ @@ -3346,7 +3346,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-cumulativesum)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-cumulativesum)), then [=exception/throw=] a {{TypeError}}. 1. If |axis| is greater than or equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}. 1. *Make graph connections:* 1. Let |output| be the result of [=copying an MLOperand=] given |input|. @@ -3405,8 +3405,8 @@ partial dictionary MLOpSupportLimits { - *pow*: Compute the values of the values of the first input tensor to the power of the values of the second input tensor, element-wise. -
Tensor limits for {{MLGraphBuilder/cumulativeSum()}}
operand
- +
Constraints for element-wise binary options
+ @@ -3592,8 +3592,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output tensor that contains the result of element-wise comparison of the two input tensors. -
Tensor limits for element-wise binary options
operand
- +
Constraints for element-wise logical options
+ @@ -3841,8 +3841,8 @@ partial dictionary MLOpSupportLimits { tensor is the same as the shape of input tensor. -
Tensor limits for element-wise logical options
operand
- +
Constraints for element-wise unary options
+ @@ -4097,8 +4097,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output tensor that contains the dequantized values. -
Tensor limits for element-wise unary options
operand
- +
Constraints for {{MLGraphBuilder/dequantizeLinear()}}
+ @@ -4152,9 +4152,9 @@ partial dictionary MLOpSupportLimits { 1. If [=this=].{{MLGraphBuilder/[[hasBuilt]]}} is true, then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |scale|, and |zeroPoint| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-dequantizelinear)), then [=exception/throw=] a {{TypeError}}. - 1. If |scale|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-dequantizelinear)), then [=exception/throw=] a {{TypeError}}. - 1. If |zeroPoint|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-dequantizelinear)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-dequantizelinear)), then [=exception/throw=] a {{TypeError}}. + 1. If |scale|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-dequantizelinear)), then [=exception/throw=] a {{TypeError}}. + 1. If |zeroPoint|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-dequantizelinear)), then [=exception/throw=] a {{TypeError}}. 1. If |scale|'s [=MLOperand/rank=] or |zeroPoint|'s [=MLOperand/rank=] is not equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}. 1. If |scale|'s [=MLOperand/shape=] is not [=list/equal=] to |zeroPoint|'s [=MLOperand/shape=], then [=exception/throw=] a {{TypeError}}. 1. If [=blockwise broadcasting=] |scale|'s [=MLOperand/shape=] and |input|'s [=MLOperand/shape=] returns false, then [=exception/throw=] a {{TypeError}}. @@ -4271,8 +4271,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output tensor that contains the quantized values. -
Tensor limits for {{MLGraphBuilder/dequantizeLinear()}}
operand
- +
Constraints for {{MLGraphBuilder/quantizeLinear()}}
+ @@ -4315,9 +4315,9 @@ partial dictionary MLOpSupportLimits { 1. If [=this=].{{MLGraphBuilder/[[hasBuilt]]}} is true, then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |scale|, and |zeroPoint| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-quantizelinear)), then [=exception/throw=] a {{TypeError}}. - 1. If |scale|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-quantizelinear)), then [=exception/throw=] a {{TypeError}}. - 1. If |zeroPoint|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-quantizelinear)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-quantizelinear)), then [=exception/throw=] a {{TypeError}}. + 1. If |scale|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-quantizelinear)), then [=exception/throw=] a {{TypeError}}. + 1. If |zeroPoint|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-quantizelinear)), then [=exception/throw=] a {{TypeError}}. 1. If |scale|'s [=MLOperand/rank=] or |zeroPoint|'s [=MLOperand/rank=] is not equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}. 1. If |scale|'s [=MLOperand/shape=] is not [=list/equal=] to |zeroPoint|'s [=MLOperand/shape=], then [=exception/throw=] a {{TypeError}}. 1. If [=blockwise broadcasting=] |scale|'s [=MLOperand/shape=] and |input|'s [=MLOperand/shape=] returns false, then [=exception/throw=] a {{TypeError}}. @@ -4390,8 +4390,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/elu(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/quantizeLinear()}}
operand
- +
Constraints for {{MLGraphBuilder/elu()}}
+ @@ -4423,7 +4423,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-elu)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-elu)), then [=exception/throw=] a {{TypeError}}. 1. Set |options|.{{MLEluOptions/alpha}} to the result of [=casting=] |options|.{{MLEluOptions/alpha}} to |input|'s [=MLOperand/dataType=]. 1. *Make graph connections:* 1. Let |output| be the result of [=copying an MLOperand=] given |input|. @@ -4475,8 +4475,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The tensor with expanded size shape. -
Tensor limits for {{MLGraphBuilder/elu()}}
operand
- +
Constraints for {{MLGraphBuilder/expand()}}
+ @@ -4510,7 +4510,7 @@ partial dictionary MLOpSupportLimits { 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. 1. Let |outputShape| be the result of [=unidirectionally broadcasting=] |input|'s [=MLOperand/shape=] and |newShape|. 1. If that returns failure, then [=exception/throw=] a {{TypeError}}. - 1. If |outputShape|'s [=list/size=] is not output tensor's [=/allowed ranks=] (according to [this table](#constraints-expand)), then [=exception/throw=] a {{TypeError}}. + 1. If |outputShape|'s [=list/size=] is not output tensor's [=/allowed ranks=] (according to [this table](#tensor-limits-expand)), then [=exception/throw=] a {{TypeError}}. 1. Let |outputDescriptor| be the result of [=creating an MLOperandDescriptor=] given |input|'s [=MLOperand/dataType=] and |outputShape|. 1. *Make graph connections:* 1. Let |output| be the result of [=creating an MLOperand=] given [=this=] and |outputDescriptor|. @@ -4565,8 +4565,8 @@ partial dictionary MLOpSupportLimits { The {{MLGraphBuilder/gather(input, indices, options)/indices}} parameter to {{MLGraphBuilder/gather()}} can not be clamped to the allowed range when the graph is built because the inputs are not known until execution. Implementations can introduce {{MLGraphBuilder/clamp()}} in the compiled graph if the specified clamping behavior is not provided by the underlying platform. Similarly, if the underlying platform does not support negative indices, the implementation can introduce operations in the compiled graph to transform a negative index from the end of the dimension into a positive index. -
Tensor limits for {{MLGraphBuilder/expand()}}
operand
- +
Constraints for {{MLGraphBuilder/gather()}}
+ @@ -4613,7 +4613,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input| and |indices| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |indices|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gather)), then [=exception/throw=] a {{TypeError}}. + 1. If |indices|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gather)), then [=exception/throw=] a {{TypeError}}. 1. Let |inputShape| be |input|'s [=MLOperand/shape=] and |inputRank| be |input|'s [=MLOperand/rank=]. 1. Let |indicesShape| be |indices|'s [=MLOperand/shape=]. 1. Let |axis| be |options|.{{MLGatherOptions/axis}}. @@ -4729,8 +4729,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to {{MLGraphBuilder/gatherElements(input, indices, options)/input}}'s [=MLOperand/rank=]. -
Tensor limits for {{MLGraphBuilder/gather()}}
operand
- +
Constraints for {{MLGraphBuilder/gatherElements()}}
+ @@ -4771,7 +4771,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input| and |indices| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |indices|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gatherelements)), then [=exception/throw=] a {{TypeError}}. + 1. If |indices|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gatherelements)), then [=exception/throw=] a {{TypeError}}. 1. If the [=MLOperand/rank=] of any of |input| or |indices| is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. Let |axis| be |options|.{{MLGatherOptions/axis}}. 1. If |axis| is greater than or equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}. @@ -4892,8 +4892,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to the {{MLGraphBuilder/gatherND(input, indices, options)/input}}'s [=MLOperand/rank=] + {{MLGraphBuilder/gatherND(input, indices, options)/indices}}'s [=MLOperand/rank=] - {{MLGraphBuilder/gatherND(input, indices, options)/indices}}'s [=MLOperand/shape=][-1] - 1. -
Tensor limits for {{MLGraphBuilder/gatherElements()}}
operand
- +
Constraints for {{MLGraphBuilder/gatherND()}}
+ @@ -4934,7 +4934,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input| and |indices| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |indices|'s [=MLOperand/dataType=]'s is not one of the [=/allowed data types=] (according to [this table](#constraints-gathernd)), then [=exception/throw=] a {{TypeError}}. + 1. If |indices|'s [=MLOperand/dataType=]'s is not one of the [=/allowed data types=] (according to [this table](#tensor-limits-gathernd)), then [=exception/throw=] a {{TypeError}}. 1. If the [=MLOperand/rank=] of any of |input| or |indices| is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. Let |inputShape| be |input|'s [=MLOperand/shape=] and |inputRank| be |input|'s [=MLOperand/rank=]. 1. Let |indicesShape| be |indices|'s [=MLOperand/shape=] and |indicesRank| be |indices|'s [=MLOperand/rank=]. @@ -5084,8 +5084,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/gelu(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/gatherND()}}
operand
- +
Constraints for {{MLGraphBuilder/gelu()}}
+ @@ -5117,7 +5117,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gelu)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gelu)), 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 "gelu" operation given |options|. @@ -5205,8 +5205,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output 2-D tensor of shape *[M, N]* that contains the calculated product of all the inputs. -
Tensor limits for {{MLGraphBuilder/gelu()}}
operand
- +
Constraints for {{MLGraphBuilder/gemm()}}
+ @@ -5260,7 +5260,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |a| and |b| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If the [=MLOperand/dataType=] of any of |a| or |b| is not one of its [=/allowed data types=] (according to [this table](#constraints-gemm)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/dataType=] of any of |a| or |b| is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gemm)), then [=exception/throw=] a {{TypeError}}. 1. If the [=MLOperand/rank=] of any of |a| or |b| is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. Set |options|.{{MLGemmOptions/alpha}} to the result of [=casting=] |options|.{{MLGemmOptions/alpha}} to |a|'s [=MLOperand/dataType=]. 1. Set |options|.{{MLGemmOptions/beta}} to the result of [=casting=] |options|.{{MLGemmOptions/beta}} to |a|'s [=MLOperand/dataType=]. @@ -5271,7 +5271,7 @@ partial dictionary MLOpSupportLimits { 1. If |shapeA|[1] is not equal to |shapeB|[0], then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLGemmOptions/c}} [=map/exists=], then: 1. If it is not [=unidirectionally broadcastable=] to the shape « |shapeA|[0], |shapeB|[1] », then [=exception/throw=] a {{TypeError}}. - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gemm)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gemm)), then [=exception/throw=] a {{TypeError}}. 1. Let |desc| be the result of [=creating an MLOperandDescriptor=] given |a|'s [=MLOperand/dataType=] and « |shapeA|[0], |shapeB|[1] ». 1. *Make graph connections:* 1. Let |output| be the result of [=creating an MLOperand=] given [=this=] and |desc|. @@ -5413,8 +5413,8 @@ partial dictionary MLOpSupportLimits { **Returns:** [=sequence=]<{{MLOperand}}>. The first element is a 3-D tensor of shape *[numDirections, batchSize, hiddenSize]*, the cell output from the last time step of the network. Additionally, if {{MLGruOptions/returnSequence}} is set to true, the second element is the 4-D output tensor of shape *[steps, numDirections, batchSize, hiddenSize]* containing every cell outputs from each time step in the temporal sequence. -
Tensor limits for {{MLGraphBuilder/gemm()}}
operand
- +
Constraints for {{MLGraphBuilder/gru()}}
+ @@ -5496,7 +5496,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |weight|, |recurrentWeight|, |options|.{{MLGruOptions/bias}} (if it [=map/exists=]), |options|.{{MLGruOptions/recurrentBias}} (if it [=map/exists=]), and |options|.{{MLGruOptions/initialHiddenState}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. - 1. If the [=MLOperand/dataType=] of any of |input|, |weight| or |recurrentWeight| is not one of its [=/allowed data types=] (according to [this table](#constraints-gru)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/dataType=] of any of |input|, |weight| or |recurrentWeight| is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gru)), then [=exception/throw=] a {{TypeError}}. 1. If the [=MLOperand/rank=] of any of |input|, |weight| or |recurrentWeight| is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. If |input|'s [=MLOperand/shape=][0] is not equal to |steps|, then [=exception/throw=] a {{TypeError}}. 1. Let |batchSize| be |input|'s [=MLOperand/shape=][1]. @@ -5510,13 +5510,13 @@ partial dictionary MLOpSupportLimits { Some underlying platforms operate on a single bias tensor which is a concatenation of {{MLGruOptions/bias}} and {{MLGruOptions/recurrentBias}}. Therefore, 3 * |hiddenSize| + 3 * |hiddenSize| also needs to be a [=valid dimension=]. 1. If |options|.{{MLGruOptions/bias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gru)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gru)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |numDirections|, 3 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLGruOptions/recurrentBias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gru)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gru)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |numDirections|, 3 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLGruOptions/initialHiddenState}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gru)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gru)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |numDirections|, |batchSize|, |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLGruOptions/activations}} [=map/exists=], then: 1. If its [=list/size=] is not 2, then [=exception/throw=] a {{TypeError}}. @@ -5743,8 +5743,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The 2-D tensor of shape *[batchSize, hiddenSize]*, the cell output hidden state of a single time step of the recurrent network. -
Tensor limits for {{MLGraphBuilder/gru()}}
operand
- +
Constraints for {{MLGraphBuilder/gruCell()}}
+ @@ -5814,8 +5814,8 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |weight|, |recurrentWeight|, |hiddenState|, |options|.{{MLGruCellOptions/bias}} (if it [=map/exists=]), and |options|.{{MLGruCellOptions/recurrentBias}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. - 1. If the [=MLOperand/dataType=] of any of |input|, |weight|, |recurrentWeight|, or |hiddenState| is not one of its [=/allowed data types=] (according to [this table](#constraints-gruCell)), then [=exception/throw=] a {{TypeError}}. - 1. If the [=MLOperand/rank=] of any of |input|, |weight|, |recurrentWeight| or |hiddenState| is not its [=/allowed ranks=] (according to [this table](#constraints-gruCell)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/dataType=] of any of |input|, |weight|, |recurrentWeight|, or |hiddenState| is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gruCell)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/rank=] of any of |input|, |weight|, |recurrentWeight| or |hiddenState| is not its [=/allowed ranks=] (according to [this table](#tensor-limits-gruCell)), then [=exception/throw=] a {{TypeError}}. 1. Let |batchSize| be |input|'s [=MLOperand/shape=][0]. 1. Let |inputSize| be |input|'s [=MLOperand/shape=][1]. 1. If |weight|'s [=MLOperand/shape=] is not [=list/equal=] to « 3 * |hiddenSize|, |inputSize| », then [=exception/throw=] a {{TypeError}}. @@ -5827,10 +5827,10 @@ partial dictionary MLOpSupportLimits { Some underlying platforms operate on a single bias tensor which is a concatenation of {{MLGruCellOptions/bias}} and {{MLGruCellOptions/recurrentBias}}. Therefore, 3 * |hiddenSize| + 3 * |hiddenSize| also needs to be a [=valid dimension=]. 1. If |options|.{{MLGruCellOptions/bias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gruCell)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gruCell)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « 3 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLGruCellOptions/recurrentBias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-gruCell)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-gruCell)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « 3 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLGruCellOptions/activations}} [=map/exists=], then: 1. If its [=list/size=] is not 2, then [=exception/throw=] a {{TypeError}}. @@ -5990,8 +5990,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/hardSigmoid(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/gruCell()}}
operand
- +
Constraints for {{MLGraphBuilder/hardSigmoid()}}
+ @@ -6023,7 +6023,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-hardSigmoid)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-hardSigmoid)), then [=exception/throw=] a {{TypeError}}. 1. Set |options|.{{MLHardSigmoidOptions/alpha}} to the result of [=casting=] |options|.{{MLHardSigmoidOptions/alpha}} to |input|'s [=MLOperand/dataType=]. 1. Set |options|.{{MLHardSigmoidOptions/beta}} to the result of [=casting=] |options|.{{MLHardSigmoidOptions/beta}} to |input|'s [=MLOperand/dataType=]. 1. *Make graph connections:* @@ -6075,8 +6075,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/hardSwish(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/hardSigmoid()}}
operand
- +
Constraints for {{MLGraphBuilder/hardSwish()}}
+ @@ -6108,7 +6108,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-hardSwish)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-hardSwish)), 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 "hardSwish" operation, given |options|. @@ -6195,8 +6195,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The instance-normalized 4-D tensor of the same shape as {{MLGraphBuilder/instanceNormalization(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/hardSwish()}}
operand
- +
Constraints for {{MLGraphBuilder/instanceNormalization()}}
+ @@ -6250,15 +6250,15 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |options|.{{MLInstanceNormalizationOptions/scale}} (if it [=map/exists=]), and |options|.{{MLInstanceNormalizationOptions/bias}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-instanceNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-instanceNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If |input|'s [=MLOperand/rank=] is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. Set |options|.{{MLInstanceNormalizationOptions/epsilon}} to the result of [=casting=] |options|.{{MLInstanceNormalizationOptions/epsilon}} to |input|'s [=MLOperand/dataType=]. 1. Let |axis| be 1 if |options|.{{MLInstanceNormalizationOptions/layout}} is {{MLInputOperandLayout/"nchw"}}, and 3 otherwise. 1. If |options|.{{MLInstanceNormalizationOptions/scale}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-instanceNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-instanceNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |input|'s [=MLOperand/shape=][|axis|] », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLInstanceNormalizationOptions/bias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-instanceNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-instanceNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |input|'s [=MLOperand/shape=][|axis|] », then [=exception/throw=] a {{TypeError}}. 1. *Make graph connections:* 1. Let |output| be the result of [=copying an MLOperand=] given |input|. @@ -6348,8 +6348,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The layer-normalized N-D tensor of the same shape as {{MLGraphBuilder/layerNormalization(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/instanceNormalization()}}
operand
- +
Constraints for {{MLGraphBuilder/layerNormalization()}}
+ @@ -6391,15 +6391,15 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |options|.{{MLLayerNormalizationOptions/scale}} (if it [=map/exists=]), and |options|.{{MLLayerNormalizationOptions/bias}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-layerNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-layerNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLayerNormalizationOptions/axes}} does not [=map/exist=], then set |options|.{{MLLayerNormalizationOptions/axes}} to a new [=/list=], either [=the range=] from 1 to |input|'s [=MLOperand/rank=], exclusive, if |input|'s [=MLOperand/rank=] is greater than 1, or an empty [=/list=] otherwise. 1. Otherwise, if |options|.{{MLLayerNormalizationOptions/axes}} contains duplicate values, or if any of its [=list/items=] is not in [=the range=] 0 to |input|'s [=MLOperand/rank=], exclusive, then [=exception/throw=] a {{TypeError}}. 1. Set |options|.{{MLLayerNormalizationOptions/epsilon}} to the result of [=casting=] |options|.{{MLLayerNormalizationOptions/epsilon}} to |input|'s [=MLOperand/dataType=]. 1. If |options|.{{MLLayerNormalizationOptions/scale}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-layerNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-layerNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/rank=] is not equal to |options|.{{MLLayerNormalizationOptions/axes}}'s [=list/size=], then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLayerNormalizationOptions/bias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-layerNormalization)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-layerNormalization)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/rank=] is not equal to |options|.{{MLLayerNormalizationOptions/axes}}'s [=list/size=], then [=exception/throw=] a {{TypeError}}. 1. [=list/For each=] |index| in [=the range=] 0 to |options|.{{MLLayerNormalizationOptions/axes}}'s [=list/size=], exclusive: 1. Let |axis| be |options|.{{MLLayerNormalizationOptions/axes}}[|index|]. @@ -6483,8 +6483,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/leakyRelu(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/layerNormalization()}}
operand
- +
Constraints for {{MLGraphBuilder/leakyRelu()}}
+ @@ -6516,7 +6516,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-leakyRelu)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-leakyRelu)), then [=exception/throw=] a {{TypeError}}. 1. Set |options|.{{MLLeakyReluOptions/alpha}} to the result of [=casting=] |options|.{{MLLeakyReluOptions/alpha}} to |input|'s [=MLOperand/dataType=]. 1. *Make graph connections:* 1. Let |output| be the result of [=copying an MLOperand=] given |input|. @@ -6581,8 +6581,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/linear(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/leakyRelu()}}
operand
- +
Constraints for {{MLGraphBuilder/linear()}}
+ @@ -6614,7 +6614,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-linear)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-linear)), then [=exception/throw=] a {{TypeError}}. 1. Set |options|.{{MLLinearOptions/alpha}} to the result of [=casting=] |options|.{{MLLinearOptions/alpha}} to |input|'s [=MLOperand/dataType=]. 1. Set |options|.{{MLLinearOptions/beta}} to the result of [=casting=] |options|.{{MLLinearOptions/beta}} to |input|'s [=MLOperand/dataType=]. 1. *Make graph connections:* @@ -6742,8 +6742,8 @@ partial dictionary MLOpSupportLimits { **Returns:** [=sequence=]<{{MLOperand}}>. The first element is a 3-D tensor of shape *[numDirections, batchSize, hiddenSize]*, the output hidden state from the last time step of the network. The second element is a 3-D tensor of shape *[numDirections, batchSize, hiddenSize]*, the output cell state from the last time step of the network. Additionally, if {{MLLstmOptions/returnSequence}} is set to true, the third element is the 4-D output tensor of shape *[steps, numDirections, batchSize, hiddenSize]* containing every output from each time step in the temporal sequence. -
Tensor limits for {{MLGraphBuilder/linear()}}
operand
- +
Constraints for {{MLGraphBuilder/lstm()}}
+ @@ -6847,7 +6847,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |weight|, |recurrentWeight|, |options|.{{MLLstmOptions/bias}} (if it [=map/exists=]), |options|.{{MLLstmOptions/recurrentBias}} (if it [=map/exists=]), |options|.{{MLLstmOptions/peepholeWeight}} (if it [=map/exists=]), |options|.{{MLLstmOptions/initialHiddenState}} (if it [=map/exists=]), and |options|.{{MLLstmOptions/initialCellState}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. 1. Let |numDirections| be 2 if |options|.{{MLLstmOptions/direction}} is {{MLRecurrentNetworkDirection/"both"}}, or 1 otherwise. - 1. If the [=MLOperand/dataType=] of any of |input|, |weight| or |recurrentWeight| is not one of its [=/allowed data types=] (according to [this table](#constraints-lstm)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/dataType=] of any of |input|, |weight| or |recurrentWeight| is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstm)), then [=exception/throw=] a {{TypeError}}. 1. If the [=MLOperand/rank=] of any of |input|, |weight| or |recurrentWeight| is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. If |steps| is 0, then [=exception/throw=] a {{TypeError}}. 1. If |input|'s [=MLOperand/shape=][0] is not equal to |steps|, then [=exception/throw=] a {{TypeError}}. @@ -6861,19 +6861,19 @@ partial dictionary MLOpSupportLimits { Some underlying platforms operate on a single bias tensor which is a concatenation of {{MLLstmOptions/bias}} and {{MLLstmOptions/recurrentBias}}. Therefore, 4 * |hiddenSize| + 4 * |hiddenSize| also needs to be a [=valid dimension=]. 1. If |options|.{{MLLstmOptions/bias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-lstm)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstm)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |numDirections|, 4 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLstmOptions/recurrentBias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-lstm)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstm)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |numDirections|, 4 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLstmOptions/peepholeWeight}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-lstm)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstm)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |numDirections|, 3 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLstmOptions/initialHiddenState}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-lstm)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstm)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |numDirections|, |batchSize|, |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLstmOptions/initialCellState}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-lstm)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstm)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « |numDirections|, |batchSize|, |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLstmOptions/activations}} [=map/exists=], then: 1. If its [=list/size=] is not 3, then [=exception/throw=] a {{TypeError}}. @@ -7140,8 +7140,8 @@ partial dictionary MLOpSupportLimits { **Returns:** [=sequence=]<{{MLOperand}}>. The first element is the output hidden state of the current time step of the recurrent network. The following element is the output cell state. Both elements are 2-D tensors of shape *[batchSize, hiddenSize]*. -
Tensor limits for {{MLGraphBuilder/lstm()}}
operand
- +
Constraints for {{MLGraphBuilder/lstmCell()}}
+ @@ -7237,7 +7237,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |weight|, |recurrentWeight|, |hiddenState|, |cellState|, |options|.{{MLLstmCellOptions/bias}} (if it [=map/exists=]), |options|.{{MLLstmCellOptions/recurrentBias}} (if it [=map/exists=]), and |options|.{{MLLstmCellOptions/peepholeWeight}} (if it [=map/exists=]) returns false, then [=exception/throw=] a {{TypeError}}. - 1. If the [=MLOperand/dataType=] of any of |input|, |weight|, |recurrentWeight|, |hiddenState| or |cellState| is not one of its [=/allowed data types=] (according to [this table](#constraints-lstmCell)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/dataType=] of any of |input|, |weight|, |recurrentWeight|, |hiddenState| or |cellState| is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstmCell)), then [=exception/throw=] a {{TypeError}}. 1. If the [=MLOperand/rank=] of any of |input|, |weight|, |recurrentWeight|, |hiddenState| or |cellState| is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. Let |batchSize| be |input|'s [=MLOperand/shape=][0]. 1. Let |inputSize| be |input|'s [=MLOperand/shape=][1]. @@ -7251,13 +7251,13 @@ partial dictionary MLOpSupportLimits { Some underlying platforms operate on a single bias tensor which is a concatenation of {{MLLstmCellOptions/bias}} and {{MLLstmCellOptions/recurrentBias}}. Therefore, 4 * |hiddenSize| + 4 * |hiddenSize| also needs to be a [=valid dimension=]. 1. If |options|.{{MLLstmCellOptions/bias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-lstmCell)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstmCell)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « 4 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLstmCellOptions/recurrentBias}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-lstmCell)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstmCell)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « 4 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLstmCellOptions/peepholeWeight}} [=map/exists=], then: - 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-lstmCell)), then [=exception/throw=] a {{TypeError}}. + 1. If its [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-lstmCell)), then [=exception/throw=] a {{TypeError}}. 1. If its [=MLOperand/shape=] is not [=list/equal=] to « 3 * |hiddenSize| », then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLLstmCellOptions/activations}} [=map/exists=], then: 1. If its [=list/size=] is not 3, then [=exception/throw=] a {{TypeError}}. @@ -7436,8 +7436,8 @@ partial dictionary MLOpSupportLimits { - If either {{MLGraphBuilder/matmul(a, b, options)/a}} or {{MLGraphBuilder/matmul(a, b, options)/b}} is `N`-dimensional where `N > 2`, it is treated as a stack of matrices with dimensions corresponding to the last two indices. The matrix multiplication will be [=broadcast=] according to [[!numpy-broadcasting-rule]]. The shapes of {{MLGraphBuilder/matmul(a, b, options)/a}} and {{MLGraphBuilder/matmul(a, b, options)/b}}, except the last two dimensions, must be [=bidirectionally broadcastable=]. The output is a `N`-dimensional tensor whose rank is the maximum [=MLOperand/rank=] of the input tensors. For each dimension, except the last two, of the output tensor, its size is the maximum size along that dimension of the input tensors. -
Tensor limits for {{MLGraphBuilder/lstmCell()}}
operand
- +
Constraints for {{MLGraphBuilder/matmul()}}
+ @@ -7474,7 +7474,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |a| and |b| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If the [=MLOperand/dataType=] of any of |a| or |b| is not one of its [=/allowed data types=] (according to [this table](#constraints-matmul)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/dataType=] of any of |a| or |b| is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-matmul)), then [=exception/throw=] a {{TypeError}}. 1. *Calculate the output shape:* 1. Let |shapeA| be a [=list/clone=] of |a|'s [=MLOperand/shape=]. 1. Let |rankA| be |a|'s [=MLOperand/rank=]. @@ -7549,8 +7549,8 @@ partial dictionary MLOpSupportLimits { `output size = beginning padding + input size + ending padding` -
Tensor limits for {{MLGraphBuilder/matmul()}}
operand
- +
Constraints for {{MLGraphBuilder/pad()}}
+ @@ -7746,8 +7746,8 @@ partial dictionary MLOpSupportLimits { `output size = ceil(1 + (input size - filter size + beginning padding + ending padding) / stride)` -
Tensor limits for {{MLGraphBuilder/pad()}}
operand
- +
Constraints for pooling operations
+ @@ -7921,8 +7921,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to the maximum of {{MLGraphBuilder/prelu(input, slope, options)/input}}'s [=MLOperand/rank=] and {{MLGraphBuilder/prelu(input, slope, options)/slope}}'s [=MLOperand/rank=]. -
Tensor limits for pooling operations
operand
- +
Constraints for {{MLGraphBuilder/prelu()}}
+ @@ -7968,7 +7968,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input| and |slope| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If the [=MLOperand/dataType=] of any of |input| or |slope| is not one of its [=/allowed data types=] (according to [this table](#constraints-prelu)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/dataType=] of any of |input| or |slope| is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-prelu)), then [=exception/throw=] a {{TypeError}}. 1. Let |outputShape| be the result of [=bidirectionally broadcasting=] |slope|'s [=MLOperand/shape=] and |input|'s [=MLOperand/shape=]. 1. If that returns failure, then [=exception/throw=] a {{TypeError}}. 1. Let |descriptor| be the result of [=creating an MLOperandDescriptor=] given |input|'s [=MLOperand/dataType=] and |outputShape|. @@ -8058,8 +8058,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] in the range 0 to {{MLGraphBuilder/reduceL1(input, options)/input}}'s [=MLOperand/rank=], inclusive, depending on {{MLReduceOptions/axes}} and {{MLReduceOptions/keepDimensions}}. If the input operand is a scalar, the reduction function is applied to the scalar value, and the output is also a scalar. -
Tensor limits for {{MLGraphBuilder/prelu()}}
operand
- +
Constraints for reduction-operations
+ @@ -8276,8 +8276,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/relu(input, options)/input}}. -
Tensor limits for reduction-operations
operand
- +
Constraints for {{MLGraphBuilder/relu()}}
+ @@ -8309,7 +8309,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-relu)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-relu)), 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 "relu" operation, given |options|. @@ -8426,8 +8426,8 @@ partial dictionary MLOpSupportLimits { The default value is [2, 3]. -
Tensor limits for {{MLGraphBuilder/relu()}}
operand
- +
Constraints for {{MLGraphBuilder/resample2d()}}
+ @@ -8459,7 +8459,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-resample2d)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-resample2d)), then [=exception/throw=] a {{TypeError}}. 1. If |input|'s [=MLOperand/rank=] is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. If |options|.{{MLResample2dOptions/scales}} does not [=map/exist=], then set it to the [=/list=] « 1.0, 1.0 ». 1. Otherwise, if any of its [=list/items=] is less than or equal to 0, or if its [=list/size=] is not 2, then [=exception/throw=] a {{TypeError}}. @@ -8537,8 +8537,8 @@ partial dictionary MLOpSupportLimits { tensor is specified by {{MLGraphBuilder/reshape(input, newShape, options)/newShape}}. -
Tensor limits for {{MLGraphBuilder/resample2d()}}
operand
- +
Constraints for {{MLGraphBuilder/reshape()}}
+ @@ -8570,7 +8570,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |newShape|'s [=list/size=] is not output tensor's [=/allowed ranks=] (according to [this table](#constraints-reshape)), then [=exception/throw=] a {{TypeError}}. + 1. If |newShape|'s [=list/size=] is not output tensor's [=/allowed ranks=] (according to [this table](#tensor-limits-reshape)), then [=exception/throw=] a {{TypeError}}. 1. Let |outputShape| be an empty array of {{unsigned long}}. 1. If |newShape|'s [=list/size=] is 0, then set |outputShape| to an empty [=/list=] for a scalar. 1. If any [=list/item=] in |newShape| is not a [=valid dimension=], then [=exception/throw=] a {{TypeError}}. @@ -8620,8 +8620,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/reverse(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/reshape()}}
operand
- +
Constraints for {{MLGraphBuilder/reverse()}}
+ @@ -8653,7 +8653,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-reverse)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-reverse)), then [=exception/throw=] a {{TypeError}}. 1. Let |inputRank| be |input|'s [=MLOperand/rank=]. 1. If |axes| is not given, then let |axes| be [=the range=] 0 to |inputRank|, exclusive. 1. Otherwise, if |axes| contains duplicate values, or if any of its elements is not in [=the range=] 0 to |inputRank|, exclusive, then return failure. @@ -8710,8 +8710,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to {{MLGraphBuilder/scatterElements(input, indices, updates, options)/input}}'s [=MLOperand/rank=]. -
Tensor limits for {{MLGraphBuilder/reverse()}}
operand
- +
Constraints for {{MLGraphBuilder/scatterElements()}}
+ @@ -8769,7 +8769,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input| and |indices| and |updates| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |indices|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-scatterelements)), then [=exception/throw=] a {{TypeError}}. + 1. If |indices|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-scatterelements)), then [=exception/throw=] a {{TypeError}}. 1. If |updates|'s [=MLOperand/dataType=] is not equal to |input|'s [=MLOperand/dataType=], then [=exception/throw=] a {{TypeError}}. 1. If the [=MLOperand/rank=] of any of |input|, |indices|, or |updates| is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. Let |axis| be |options|.{{MLScatterOptions/axis}}. @@ -8923,8 +8923,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to {{MLGraphBuilder/scatterND(input, indices, updates, options)/input}}'s [=MLOperand/rank=] + {{MLGraphBuilder/scatterND(input, indices, updates, options)/indices}}'s [=MLOperand/rank=] - {{MLGraphBuilder/scatterND(input, indices, updates, options)/indices}}'s [=MLOperand/shape=][-1] - 1. -
Tensor limits for {{MLGraphBuilder/scatterElements()}}
operand
- +
Constraints for {{MLGraphBuilder/scatterND()}}
+ @@ -8970,7 +8970,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and any of |input|, |indices|, and |updates| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |indices|'s [=MLOperand/dataType=]'s is not one of the [=/allowed data types=] (according to [this table](#constraints-scatternd)), then [=exception/throw=] a {{TypeError}}. + 1. If |indices|'s [=MLOperand/dataType=]'s is not one of the [=/allowed data types=] (according to [this table](#tensor-limits-scatternd)), then [=exception/throw=] a {{TypeError}}. 1. If |updates|'s [=MLOperand/dataType=] is not equal to |input|'s [=MLOperand/dataType=], then [=exception/throw=] a {{TypeError}}. 1. If the [=MLOperand/rank=] of any of |input|, |indices|, or |updates| is not its [=/allowed rank=], then [=exception/throw=] a {{TypeError}}. 1. Let |inputShape| be |input|'s [=MLOperand/shape=] and |inputRank| be |input|'s [=MLOperand/rank=]. @@ -9128,8 +9128,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/sigmoid(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/scatterND()}}
operand
- +
Constraints for {{MLGraphBuilder/sigmoid()}}
+ @@ -9161,7 +9161,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-sigmoid)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-sigmoid)), 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 "sigmoid" operation, given |options|. @@ -9227,8 +9227,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output tensor of the same rank as the input tensor with tensor values stripped to the specified starting and ending indices in each dimension. -
Tensor limits for {{MLGraphBuilder/sigmoid()}}
operand
- +
Constraints for {{MLGraphBuilder/slice()}}
+ @@ -9317,8 +9317,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output N-D tensor that contains the softmax results, of the same shape as {{MLGraphBuilder/softmax(input, axis, options)/input}}. -
Tensor limits for {{MLGraphBuilder/slice()}}
operand
- +
Constraints for {{MLGraphBuilder/softmax()}}
+ @@ -9350,7 +9350,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-softmax)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-softmax)), then [=exception/throw=] a {{TypeError}}. 1. If |axis| is greater than or equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}. 1. *Make graph connections:* 1. Let |output| be the result of [=copying an MLOperand=] given |input|. @@ -9405,8 +9405,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/softplus(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/softmax()}}
operand
- +
Constraints for {{MLGraphBuilder/softplus()}}
+ @@ -9438,7 +9438,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-softplus)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-softplus)), 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 "softplus" operation and |options|. @@ -9498,8 +9498,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/softsign(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/softplus()}}
operand
- +
Constraints for {{MLGraphBuilder/softsign()}}
+ @@ -9531,7 +9531,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-softsign)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-softsign)), 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 "softsign" operation and |options|. @@ -9581,8 +9581,8 @@ partial dictionary MLOpSupportLimits { The dimension along which to split. Its value must be in the range [0, N-1] where N is the [=MLOperand/rank=] of the input tensor. -
Tensor limits for {{MLGraphBuilder/softsign()}}
operand
- +
Constraints for {{MLGraphBuilder/split()}}
+ @@ -9697,8 +9697,8 @@ partial dictionary MLOpSupportLimits { - an {{MLOperand}}. The output tensor of the same shape as {{MLGraphBuilder/tanh(input, options)/input}}. -
Tensor limits for {{MLGraphBuilder/split()}}
operand
- +
Constraints for {{MLGraphBuilder/tanh()}}
+ @@ -9730,7 +9730,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#constraints-tanh)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/dataType=] is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-tanh)), 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 "tanh" operation, given |options|. @@ -9783,8 +9783,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The reversed N-D tensor. -
Tensor limits for {{MLGraphBuilder/tanh()}}
operand
- +
Constraints for {{MLGraphBuilder/tile()}}
+ @@ -9868,8 +9868,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The permuted or transposed N-D tensor. -
Tensor limits for {{MLGraphBuilder/tile()}}
operand
- +
Constraints for {{MLGraphBuilder/transpose()}}
+ @@ -9951,8 +9951,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output tensor representing a triangular matrix, or batch of matrices which is the same shape as the input. -
Tensor limits for {{MLGraphBuilder/transpose()}}
operand
- +
Constraints for {{MLGraphBuilder/triangular()}}
+ @@ -9984,7 +9984,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}. 1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}. - 1. If |input|'s [=MLOperand/rank=] is not one of its [=/allowed ranks=] (according to [this table](#constraints-triangular)), then [=exception/throw=] a {{TypeError}}. + 1. If |input|'s [=MLOperand/rank=] is not one of its [=/allowed ranks=] (according to [this table](#tensor-limits-triangular)), 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 "triangular" operation, given |options|. @@ -10091,8 +10091,8 @@ partial dictionary MLOpSupportLimits { **Returns:** an {{MLOperand}}. The output tensor that contains the values selected element-wise from either the {{MLGraphBuilder/where(condition, trueValue, falseValue, options)/trueValue}} or the {{MLGraphBuilder/where(condition, trueValue, falseValue, options)/falseValue}} tensor. -
Tensor limits for {{MLGraphBuilder/triangular()}}
operand
- +
Constraints for {{MLGraphBuilder/where()}}
+ @@ -10147,7 +10147,7 @@ partial dictionary MLOpSupportLimits { 1. If [=this=] [=MLGraphBuilder/can not build=], 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 the [=MLOperand/dataType=] of any of |condition|, |trueValue|, or |falseValue| is not one of its [=/allowed data types=] (according to [this table](#constraints-where)), then [=exception/throw=] a {{TypeError}}. + 1. If the [=MLOperand/dataType=] of any of |condition|, |trueValue|, or |falseValue| is not one of its [=/allowed data types=] (according to [this table](#tensor-limits-where)), 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|.
Tensor limits for {{MLGraphBuilder/where()}}
operand