Skip to content

Commit 5aec997

Browse files
authored
Merge pull request #882 from huningxin/fix_allowed_ranks
Bugfix: Only allow 1 to N rank input for operators that take 1 axis
2 parents fd97301 + a4e0745 commit 5aec997

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

index.bs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,7 +2243,7 @@ partial dictionary MLOpSupportLimits {
22432243
<tr>
22442244
<td>{{input}}</td>
22452245
<td>[=/any data type|any=]</td>
2246-
<td>[=/any rank|N=]</td>
2246+
<td>1 to [=/any rank|N=]</td>
22472247
</tr>
22482248
<tr>
22492249
<td>*output*</td>
@@ -2267,6 +2267,7 @@ partial dictionary MLOpSupportLimits {
22672267
1. [=Assert=]: |op| is one of "argMin", "argMax".
22682268
1. If [=this=] [=MLGraphBuilder/can not build=], then [=exception/throw=] an "{{InvalidStateError}}" {{DOMException}}.
22692269
1. If [=MLGraphBuilder/validating operand=] with [=this=] and |input| returns false, then [=exception/throw=] a {{TypeError}}.
2270+
1. If |axis| is greater than or equal to |input|'s [=MLOperand/rank=], then [=exception/throw=] a {{TypeError}}.
22702271
1. If |input|'s [=MLOperand/shape=][|axis|] is greater than |options|.{{MLArgMinMaxOptions/outputDataType}}'s maximum value, then [=exception/throw=] a {{TypeError}}.
22712272
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}}.
22722273
1. Let |desc| be the result of [=creating an MLOperandDescriptor=] given |options|.{{MLArgMinMaxOptions/outputDataType}} and |outputShape|.
@@ -2369,7 +2370,7 @@ partial dictionary MLOpSupportLimits {
23692370
<tr>
23702371
<td>{{input}}</td>
23712372
<td>{{MLOperandDataType/"float32"}}, {{MLOperandDataType/"float16"}}</td>
2372-
<td>[=/any rank|N=]</td>
2373+
<td>1 to [=/any rank|N=]</td>
23732374
</tr>
23742375
<tr>
23752376
<td>{{mean}}</td>
@@ -2753,7 +2754,7 @@ partial dictionary MLOpSupportLimits {
27532754
<tr>
27542755
<td>{{inputs}}'s [=list/items=]</td>
27552756
<td>[=/any data type|any=]</td>
2756-
<td>[=/any rank|N=]</td>
2757+
<td>1 to [=/any rank|N=]</td>
27572758
</tr>
27582759
<tr>
27592760
<td>*output*</td>
@@ -3307,7 +3308,7 @@ partial dictionary MLOpSupportLimits {
33073308
<tr>
33083309
<td>{{input}}</td>
33093310
<td>[=/any data type|any=]</td>
3310-
<td>[=/any rank|N=]</td>
3311+
<td>1 to [=/any rank|N=]</td>
33113312
</tr>
33123313
<tr>
33133314
<td>*output*</td>
@@ -4579,7 +4580,7 @@ partial dictionary MLOpSupportLimits {
45794580
<tr>
45804581
<td>{{input}}</td>
45814582
<td>[=/any data type|any=]</td>
4582-
<td>[=/any rank|N=]</td>
4583+
<td>1 to [=/any rank|N=]</td>
45834584
</tr>
45844585
<tr>
45854586
<td>{{indices}}</td>
@@ -9318,7 +9319,7 @@ partial dictionary MLOpSupportLimits {
93189319
<tr>
93199320
<td>{{input}}</td>
93209321
<td>{{MLOperandDataType/"float32"}}, {{MLOperandDataType/"float16"}}</td>
9321-
<td>[=/any rank|N=]</td>
9322+
<td>1 to [=/any rank|N=]</td>
93229323
</tr>
93239324
<tr>
93249325
<td>*output*</td>
@@ -9582,7 +9583,7 @@ partial dictionary MLOpSupportLimits {
95829583
<tr>
95839584
<td>{{input}}</td>
95849585
<td>[=/any data type|any=]</td>
9585-
<td>[=/any rank|N=]</td>
9586+
<td>1 to [=/any rank|N=]</td>
95869587
</tr>
95879588
<tr>
95889589
<td>*outputs*</td>

0 commit comments

Comments
 (0)