+
**Arguments:**
- - input: an {{MLOperand}}. The input tensor.
- - options: an {{MLOperatorOptions}}. Specifies the optional parameters of the operation.
+ - input: an {{MLOperand}}. The input N-D tensor from which the values are gathered.
+ - indices: an {{MLOperand}}. The indices N-D tensor of the input values to gather. The values must be of type {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}} or {{MLOperandDataType/"int64"}}, and must be in the range -N (inclusive) to N (exclusive) where N is the size of the input dimension indexed by *options.axis*, and a negative index means indexing from the end of the dimension.
+ - options: an optional {{MLGatherOptions}}. The optional parameters of the operation.
- **Returns:**
+ **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to the [=MLOperand/rank=] of *input*.
+
+
+{{MLGatherSupportLimits}} has the following members:
+
+ : input
+ :: {{MLSupportLimits}} for input operand.
+ : indices
+ :: {{MLSupportLimits}} for indices operand.
+ : output
+ :: {{MLSupportLimits}} for output operand.
+
+
+
+ Constraints for {{MLGraphBuilder/gatherElements()}}
+
+
+ operand |
+ [=/allowed data types=] |
+ [=/allowed ranks=] |
+
+
+
+ {{input}} |
+ [=/any data type|any=] |
+ > 1 |
+
+
+ {{indices}} |
+ {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}}, {{MLOperandDataType/"int64"}} |
+ *input*'s [=MLOperand/rank=] |
+
+
+ *output* |
+ [=/same type as|same as=] {{input}} |
+ *input*'s [=MLOperand/rank=] |
+
+
+
+{{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/gatherElements()}}:
+
+ : gatherElements
+ :: Support limits for operator {{MLGraphBuilder/gatherElements()}}.
+
+
+
+ The {{MLGraphBuilder/gatherElements(input, indices, options)/indices}} parameter to {{MLGraphBuilder/gatherElements()}} 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 required 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.
+
+
+
+
+ The gatherElements(|input|, |indices|, |options|) method steps are:
+
+ TODO:
+
+
+
+
+
+ Examples of how gatherElements works in different slicing schemes.
+
+
+ TODO:
+
+
+
+
+### gatherND ### {#api-mlgraphbuilder-gathernd}
+Gather values of the input tensor along an axis according to the indices.
+
+
+
+
+ **Arguments:**
+ - input: an {{MLOperand}}. The input N-D tensor from which the values are gathered.
+ - indices: an {{MLOperand}}. The indices N-D tensor of the input values to gather. The values must be of type {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}} or {{MLOperandDataType/"int64"}}, and must be in the range -N (inclusive) to N (exclusive) where N is the size of the input dimension indexed by *options.axis*, and a negative index means indexing from the end of the dimension.
+ - options: an optional {{MLOperatorOptions}}. The optional parameters of the operation.
+
+ **Returns:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to the *input*'s [=MLOperand/rank=] + *indices*'s [=MLOperand/rank=] - *indices*'s [=MLOperand/shape=][-1] - 1.
+
+
+
+ Constraints for {{MLGraphBuilder/gatherND()}}
+
+
+ operand |
+ [=/allowed data types=] |
+ [=/allowed ranks=] |
+
+
+
+ {{input}} |
+ [=/any data type|any=] |
+ > 1 |
+
+
+ {{indices}} |
+ {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}}, {{MLOperandDataType/"int64"}} |
+ > 1 |
+
+
+ *output* |
+ [=/same type as|same as=] {{input}} |
+ *input*'s [=MLOperand/rank=] + *indices*'s [=MLOperand/rank=] - *indices*'s [=MLOperand/shape=][-1] - 1 |
+
+
+
+{{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/gatherND()}}:
+
+ : gatherND
+ :: Support limits for operator {{MLGraphBuilder/gatherND()}}.
+
+
+
+ The {{MLGraphBuilder/gatherND(input, indices, options)/indices}} parameter to {{MLGraphBuilder/gatherND()}} 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 required 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.
+
+
+
+
+ The gatherND(|input|, |indices|, |options|) method steps are:
+
+ TODO:
+
+
+
+
+
+ Examples of how gatherND works in different slicing schemes.
+
+
+ TODO:
+
+
+
+
+### gelu ### {#api-mlgraphbuilder-gelu-method}
+Compute the
gaussian error linear unit function (GELU) of the input tensor. The calculation follows the expression `0.5 * x * (1 + erf(x / sqrt(2)))`.
+
+
+
+
+ **Arguments:**
+ - input: an {{MLOperand}}. The input tensor.
+ - options: an {{MLOperatorOptions}}. Specifies the optional parameters of the operation.
+
+ **Returns:**
- an {{MLOperand}}. The output tensor of the same shape as *input*.
@@ -5086,6 +5642,7 @@ partial dictionary MLOpSupportLimits {
:
axes
::
The indices to the input dimensions to reduce. When this member is not present, it is treated as if all dimensions except the first were given (e.g. for a 4-D input tensor, axes = [1,2,3]). That is, the reduction for the mean and variance values are calculated across all the input features for each independent batch. If empty, no dimensions are reduced.
+
:
epsilon
::
A small value to prevent computational error due to divide-by-zero.
@@ -7256,6 +7813,299 @@ partial dictionary MLOpSupportLimits {
1. Return |output|.
+### reverse ### {#api-mlgraphbuilder-reverse-method}
+Reverse a tensor along the given axes.
+
+
+
+{{MLReverseOptions}} has the following members:
+
+ : axes
+ ::
+ The indices to the input dimensions to reverse. When this member is not present, it is treated as if all dimensions are reversed. If explicitly passed as empty, no dimensions are reversed.
+
+
+
+ **Arguments:**
+ - input: an {{MLOperand}}. The input tensor.
+ - options: an {{MLOperatorOptions}}. Specifies the optional parameters of the operation.
+
+ **Returns:**
+ - an {{MLOperand}}. The output tensor of the same shape as *input*.
+
+
+
+ Constraints for {{MLGraphBuilder/reverse()}}
+
+
+ operand |
+ [=/allowed data types=] |
+ [=/allowed ranks=] |
+
+
+
+ {{input}} |
+ [=/any data type|any=] |
+ [=/any rank|N=] |
+
+
+ *output* |
+ [=/same type as|same as=] {{input}} |
+ [=/same rank as|same as=] {{input}} |
+
+
+
+{{MLOpSupportLimits}} has the following member for {{MLGraphBuilder/reverse()}}:
+
+ : reverse
+ :: Support limits for operator {{MLGraphBuilder/reverse()}}.
+
+
+
+
+ The reverse(|input|, |options|) method steps are:
+
+ 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. *Make graph connections:*
+ 1. Let |output| be the result of [=copying an MLOperand=] given |input|.
+ 1. Let |operator| be an [=operator=] for the "reverse" operation and |options|.
+ 1. Set |output|.{{MLOperand/[[operator]]}} to |operator|.
+ 1. Set |operator|'s [=operator/input=] to |input|.
+ 1. Set |operator|'s [=operator/output=] to |output|.
+ 1. Return |output|.
+
+
+### scatterElements ### {#api-mlgraphbuilder-scatterelements}
+Scatter values from the updates tensor along an axis according to the indices in place of the input tensor.
+
+
+
+{{MLScatterOptions}} has the following members:
+
+ : axis
+ ::
+ The axis along which the scattered values are obtained. Its value must be in the range [0, N-1] where N is the [=MLOperand/rank=] of the input tensor.
+
+
+
+ **Arguments:**
+ - input: an {{MLOperand}}. The input N-D tensor from which the values are scattered.
+ - indices: an {{MLOperand}}. The indices N-D tensor of the input values to scatter over. The values must be of type {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}} or {{MLOperandDataType/"int64"}}, and must be in the range -N (inclusive) to N (exclusive) where N is the size of the input dimension indexed by *options.axis*, and a negative index means indexing from the end of the dimension.
+ - 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 *input*'s [=MLOperand/rank=].
+
+
+
+ Constraints for {{MLGraphBuilder/scatterElements()}}
+
+
+ operand |
+ [=/allowed data types=] |
+ [=/allowed ranks=] |
+
+
+
+ {{input}} |
+ [=/any data type|any=] |
+ > 1 |
+
+
+ {{indices}} |
+ {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}}, {{MLOperandDataType/"int64"}} |
+ {{input}}'s [=MLOperand/rank=] |
+
+
+ {{updates}} |
+ [=/same type as|same as=] {{input}} |
+ {{input}}'s [=MLOperand/rank=] and {{indices}}'s [=MLOperand/shape=] |
+
+
+ *output* |
+ [=/same type as|same as=] {{input}} |
+ {{input}}'s [=MLOperand/rank=] |
+
+
+
+{{MLScatterSupportLimits}} has the following members:
+
+ : input
+ :: {{MLSupportLimits}} for input operand.
+ : indices
+ :: {{MLSupportLimits}} for indices operand.
+ : updates
+ :: {{MLSupportLimits}} for updates operand.
+ : output
+ :: {{MLSupportLimits}} for output operand.
+
+
+{{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/scatterElements()}}:
+
+ : scatterElements
+ :: Support limits for operator {{MLGraphBuilder/scatterElements()}}.
+
+
+
+ The {{MLGraphBuilder/scatterElements(input, indices, updates, options)/indices}} parameter to {{MLGraphBuilder/scatterElements()}} 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 required 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.
+
+
+
+
+ The scatterElements(|input|, |indices|, |updates|, |options|) method steps are:
+
+ TODO:
+
+
+
+
+
+ Examples of how scatterElements works in different slicing schemes.
+
+
+ TODO:
+
+
+
+
+
+### scatterND ### {#api-mlgraphbuilder-scatternd}
+Scatter values of the input tensor along an axis according to the indices.
+
+
+
+
+ **Arguments:**
+ - input: an {{MLOperand}}. The input N-D tensor from which the values are scattered.
+ - indices: an {{MLOperand}}. TODO: Elaborate on indices coordinate order. The indices N-D tensor of the input values to scatter. The values must be of type {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}} or {{MLOperandDataType/"int64"}}, and must be in the range -N (inclusive) to N (exclusive) where N is the size of the input dimension indexed by *options.axis*, and a negative index means indexing from the end of the dimension.
+ - 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 *input*'s [=MLOperand/rank=] + *indices*'s [=MLOperand/rank=] - *indices*'s [=MLOperand/shape=][-1] - 1.
+
+
+{{MLScatterSupportLimits}} has the following members:
+
+ : input
+ :: {{MLSupportLimits}} for input operand.
+ : indices
+ :: {{MLSupportLimits}} for indices operand.
+ : updates
+ :: {{MLSupportLimits}} for updates operand.
+ : output
+ :: {{MLSupportLimits}} for output operand.
+
+
+
+ Constraints for {{MLGraphBuilder/scatterND()}}
+
+
+ operand |
+ [=/allowed data types=] |
+ [=/allowed ranks=] |
+
+
+
+ {{input}} |
+ [=/any data type|any=] |
+ > 1 |
+
+
+ {{indices}} |
+ {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}}, {{MLOperandDataType/"int64"}} |
+ > 1 |
+
+
+ {{updates}} |
+ [=/same type as|same as=] {{input}} |
+ *input*'s [=MLOperand/rank=] + *indices*'s [=MLOperand/rank=] - *indices*'s [=MLOperand/shape=][-1] - 1 |
+
+
+ *output* |
+ [=/same type as|same as=] {{input}} |
+ > 1 |
+
+
+
+{{MLOpSupportLimits}} has the following members for {{MLGraphBuilder/scatterND()}}:
+
+ : scatterND
+ :: Support limits for operator {{MLGraphBuilder/scatterND()}}.
+
+
+
+ The {{MLGraphBuilder/scatterND(input, indices, options)/indices}} parameter to {{MLGraphBuilder/scatterND()}} 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 required 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.
+
+
+
+
+ The scatterND(|input|, |indices|, |updates|, |options|) method steps are:
+
+ TODO:
+
+
+
+
+
+ Examples of how scatterND works in different slicing schemes.
+
+
+ TODO:
+
+
+
+
### sigmoid ### {#api-mlgraphbuilder-sigmoid-method}
Compute the
sigmoid function of the input tensor. The calculation follows the expression `1 / (exp(-x) + 1)`.
@@ -7340,23 +8190,39 @@ partial dictionary MLOpSupportLimits {
### slice ### {#api-mlgraphbuilder-slice}
Produce a slice of the input tensor.
+
+{{MLSliceOptions}} has the following members:
+
+ : strides
+ ::
+ The stride to step over each input along each axis.
+ The length of the strides array must equal the [=MLOperand/rank=] of the input tensor.
+ The the default is an array of length [=MLOperand/rank=] consisting of all 1's.
+ e.g. [1,1,1] for a 3-D tensor.
+ Strides must be greater than zero.
+
+
**Arguments:**
- input: an {{MLOperand}}. The input tensor.
- starts: [=sequence=]<{{unsigned long}}>. The starting index to slice of each input dimension, of length N where N is the [=MLOperand/rank=] of the input tensor. For each dimension *d* of *input*, *starts[d]* indicates the starting index to slice in that dimension. The starting index must be in the range [0, input size - 1] in that dimension.
- sizes: [=sequence=]<{{unsigned long}}>. The number of elements to slice of each input dimension, of length N where N is the [=MLOperand/rank=] of the input tensor. For each dimension *d* of *input*, *sizes[d]* indicates the number of elements to slice in that dimension. The size must not be 0 and must satisfy the constraint `starting index + size <= input size` in that dimension.
- - options: an {{MLOperatorOptions}}. Specifies the optional parameters of the operation.
+ - options: an {{MLSliceOptions}}. Specifies the optional parameters of the operation.
**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.
@@ -7396,6 +8262,8 @@ partial dictionary MLOpSupportLimits {
1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}.
1. If any of |sizes|'s [=list/items=] are 0, then [=exception/throw=] a {{TypeError}}.
1. If |starts|'s [=list/size=] and |sizes|'s [=list/size=] are not both equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}.
+ 1. If |options|.{{MLSliceOptions/strides}} [=map/exists=]:
+ 1. If |options|.{{MLSliceOptions/strides}}'s [=list/size=] is not equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}.
1. [=list/For each=] |index| in [=the range=] 0 to |input|'s [=MLOperand/rank=], exclusive:
1. If |sizes|[|index|] is 0, then [=exception/throw=] a {{TypeError}}.
@@ -7403,6 +8271,8 @@ partial dictionary MLOpSupportLimits {
1. If |starts|[|index|] is greater than or equal to |input|'s [=MLOperand/shape=][|index|], then [=exception/throw=] a {{TypeError}}.
1. If |starts|[|index|] + |sizes|[|index|] is greater than |input|'s [=MLOperand/shape=][|index|], then [=exception/throw=] a {{TypeError}}.
+ 1. If |options|.{{MLSliceOptions/strides}} [=map/exists=]:
+ 1. If |options|.{{MLSliceOptions/strides}}[|index|] is less than 1, 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 "slice" operation, given |starts|, |sizes|, and |options|.
@@ -7878,6 +8748,77 @@ partial dictionary MLOpSupportLimits {
+### tile ### {#api-mlgraphbuilder-tile}
+Repeat a tensor the given number of times along each dimension.
+
+
+
+