From 3c9dd9256721e769acc5ed81a4dcddb679a76d12 Mon Sep 17 00:00:00 2001 From: Dwayne Robinson Date: Wed, 23 Oct 2024 16:47:45 -0700 Subject: [PATCH 1/6] Remove pool2d MLRoundingType --- index.bs | 48 +++++++++++++----------------------------------- 1 file changed, 13 insertions(+), 35 deletions(-) diff --git a/index.bs b/index.bs index 095f8e3f..0ddf45b2 100644 --- a/index.bs +++ b/index.bs @@ -4575,10 +4575,6 @@ partial interface MLGraphBuilder { ### Pooling operations ### {#api-mlgraphbuilder-pool2d} Compute a pooling operation across all the elements within the moving window over the input tensor. @@ -5449,7 +5449,7 @@ partial dictionary MLOpSupportLimits {
- To calculate pool2d output sizes given {{MLInputOperandLayout}} |layout|, [=/list=] of 4 unsigned integers |inputShape|, [=/list=] of 2 unsigned integers |windowDimensions|, [=/list=] of 4 unsigned integers |padding|, [=/list=] of 2 unsigned integers |strides|, [=/list=] of 2 unsigned integers |dilations|, and optional [=/list=] of 2 unsigned integers |outputSizes|, perform these steps. They return a [=/list=] of 4 unsigned integers. + To calculate pool2d output sizes given {{MLInputOperandLayout}} |layout|, [=/list=] of 4 unsigned integers |inputShape|, [=/list=] of 2 unsigned integers windowDimensions, [=/list=] of 4 unsigned integers padding, [=/list=] of 2 unsigned integers strides, [=/list=] of 2 unsigned integers dilations, and optional [=/list=] of 2 unsigned integers |outputSizes|, perform these steps. They return a [=/list=] of 4 unsigned integers. 1. Switch on |layout|:
From 8761da5bccfdf3a52f611abade6e60993be390b8 Mon Sep 17 00:00:00 2001 From: Dwayne Robinson Date: Wed, 13 Nov 2024 16:10:39 -0800 Subject: [PATCH 4/6] Make outputSizes required --- index.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.bs b/index.bs index 69513914..ddf4f2a5 100644 --- a/index.bs +++ b/index.bs @@ -5354,13 +5354,13 @@ dictionary MLPool2dOptions : MLOperatorOptions { sequence<[EnforceRange] unsigned long> strides; sequence<[EnforceRange] unsigned long> dilations; MLInputOperandLayout layout = "nchw"; - sequence<[EnforceRange] unsigned long> outputSizes; + required sequence<[EnforceRange] unsigned long> outputSizes; }; partial interface MLGraphBuilder { - MLOperand averagePool2d(MLOperand input, optional MLPool2dOptions options = {}); - MLOperand l2Pool2d(MLOperand input, optional MLPool2dOptions options = {}); - MLOperand maxPool2d(MLOperand input, optional MLPool2dOptions options = {}); + MLOperand averagePool2d(MLOperand input, required MLPool2dOptions options); + MLOperand l2Pool2d(MLOperand input, required MLPool2dOptions options); + MLOperand maxPool2d(MLOperand input, required MLPool2dOptions options); }; partial dictionary MLOpSupportLimits { From 84d78fe47d4afda21d10424d860cd4cec5e378e7 Mon Sep 17 00:00:00 2001 From: Dwayne Robinson Date: Wed, 13 Nov 2024 16:13:57 -0800 Subject: [PATCH 5/6] Nit extra space after required --- index.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.bs b/index.bs index bc2877d2..e3a53783 100644 --- a/index.bs +++ b/index.bs @@ -5295,8 +5295,8 @@ dictionary MLPool2dOptions : MLOperatorOptions { partial interface MLGraphBuilder { MLOperand averagePool2d(MLOperand input, required MLPool2dOptions options); - MLOperand l2Pool2d(MLOperand input, required MLPool2dOptions options); - MLOperand maxPool2d(MLOperand input, required MLPool2dOptions options); + MLOperand l2Pool2d(MLOperand input, required MLPool2dOptions options); + MLOperand maxPool2d(MLOperand input, required MLPool2dOptions options); }; partial dictionary MLOpSupportLimits { From 54aacac93c0ffcd4c1d6af48f6351e9b1be329fa Mon Sep 17 00:00:00 2001 From: Dwayne Robinson Date: Wed, 13 Nov 2024 16:25:09 -0800 Subject: [PATCH 6/6] Revert required dictionary since it causes bikeshed errors --- index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index e3a53783..c6fa24bd 100644 --- a/index.bs +++ b/index.bs @@ -5294,9 +5294,9 @@ dictionary MLPool2dOptions : MLOperatorOptions { }; partial interface MLGraphBuilder { - MLOperand averagePool2d(MLOperand input, required MLPool2dOptions options); - MLOperand l2Pool2d(MLOperand input, required MLPool2dOptions options); - MLOperand maxPool2d(MLOperand input, required MLPool2dOptions options); + MLOperand averagePool2d(MLOperand input, optional MLPool2dOptions options = {}); + MLOperand l2Pool2d(MLOperand input, optional MLPool2dOptions options = {}); + MLOperand maxPool2d(MLOperand input, optional MLPool2dOptions options = {}); }; partial dictionary MLOpSupportLimits {