Skip to content

Commit

Permalink
Merge pull request #685 from huningxin/gather_indicies_int32
Browse files Browse the repository at this point in the history
Support int32 data type for 'indices' operand of 'gather' operator
  • Loading branch information
huningxin committed May 11, 2024
2 parents 587af73 + 0cbabce commit dafa2ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2667,7 +2667,7 @@ partial interface MLGraphBuilder {
<div>
**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/"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.
- *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:** an {{MLOperand}}. The output N-D tensor of [=MLOperand/rank=] equal to the [=MLOperand/rank=] of *input* + the [=MLOperand/rank=] of *indices* - 1.
Expand All @@ -2682,7 +2682,7 @@ partial interface MLGraphBuilder {
The <dfn method for=MLGraphBuilder>gather(|input|, |indices|, |options|)</dfn> method steps are:
</summary>
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 {{MLOperandDataType/"uint32"}} or {{MLOperandDataType/"int64"}}, then [=exception/throw=] a {{TypeError}}.
1. If |indices|'s [=MLOperand/dataType=] is not {{MLOperandDataType/"int32"}}, {{MLOperandDataType/"uint32"}} or {{MLOperandDataType/"int64"}}, then [=exception/throw=] a {{TypeError}}.
1. Let |shapeInput| be |input|'s [=MLOperand/shape=] and |rankInput| be |shapeInput|'s [=MLOperand/rank=].
1. Let |shapeIndices| be |indices|'s [=MLOperand/shape=].
1. Let |axis| be |options|.{{MLGatherOptions/axis}}.
Expand Down

0 comments on commit dafa2ba

Please sign in to comment.