@@ -8845,16 +8845,18 @@ partial dictionary MLOpSupportLimits {
8845
8845
1. Let |inputShape| be |input|'s [=MLOperand/shape=] and |inputRank| be |input|'s [=MLOperand/rank=].
8846
8846
1. Let |outputShape| be a new [=/list=].
8847
8847
1. [=list/For each=] |index| in [=the range=] 0 to |inputRank|, exclusive:
8848
- 1. If |sizes|[|index|] is 0, then [=exception/throw=] a {{TypeError}}.
8848
+ 1. Let |inputSize| be |inputShape|[|index|].
8849
+ 1. Let |inputSliceSize| be |sizes|[|index|].
8850
+ 1. Let |stride| be |strides|[|index|] if it is not empty, or 1 otherwise:
8851
+ 1. If |inputSliceSize| is 0, then [=exception/throw=] a {{TypeError}}.
8849
8852
8850
8853
Issue(391): If 0-size dimensions are allowed, revise these steps.
8851
8854
8852
- 1. If |starts|[|index|] is greater than |inputShape|[|index|], then [=exception/throw=] a {{TypeError}}.
8853
- 1. If |starts|[|index|] + |sizes|[|index|] is greater than |inputShape|[|index|], then [=exception/throw=] a {{TypeError}}.
8854
- 1. Let |stride| be |strides|[|index|] if it is not empty, or 1 otherwise:
8855
8855
1. If |stride| is less than 1, then [=exception/throw=] a {{TypeError}}.
8856
- 1. Let |outputSizeRoundingExcess| be 1 if |inputShape|[|index|] % |stride| != 0, or 0 otherwise.
8857
- 1. Let |outputSize| be |inputShape|[|index|] / |stride| + |outputSizeRoundingExcess|
8856
+ 1. If |starts|[|index|] is greater than |inputSize|, then [=exception/throw=] a {{TypeError}}.
8857
+ 1. If |starts|[|index|] + |inputSliceSize| is greater than |inputSize|, then [=exception/throw=] a {{TypeError}}.
8858
+ 1. Let |outputSizeRoundingExcess| be 1 if |inputSliceSize| % |stride| != 0, or 0 otherwise.
8859
+ 1. Let |outputSize| be |inputSliceSize| / |stride| + |outputSizeRoundingExcess|
8858
8860
1. [=list/Append=] |outputSize| to |outputShape|.
8859
8861
1. Let |outputDesc| be the result of [=creating an MLOperandDescriptor=] given |input|'s [=MLOperand/dataType=] and |outputShape|.
8860
8862
1. *Make graph connections:*
0 commit comments