Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unsigned long for size related options of conv2d, convTranspose2d and pooling operations #294

Merged
merged 2 commits into from
Dec 20, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
60 changes: 30 additions & 30 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,11 @@ enum MLAutoPad {
};

dictionary MLConv2dOptions {
sequence<long> padding;
sequence<long> strides;
sequence<long> dilations;
sequence<unsigned long> padding;
sequence<unsigned long> strides;
sequence<unsigned long> dilations;
MLAutoPad autoPad = "explicit";
long groups = 1;
unsigned long groups = 1;
MLInputOperandLayout inputLayout = "nchw";
MLConv2dFilterOperandLayout filterLayout = "oihw";
MLOperand bias;
Expand All @@ -1081,11 +1081,11 @@ partial interface MLGraphBuilder {
- *filter*: an {{MLOperand}}. The filter 4-D tensor. The logical shape is
interpreted according to the value of *options.filterLayout* and *options.groups*.
- *options*: an optional {{MLConv2dOptions}}. The optional parameters of the operation.
- *padding*: a sequence of {{long}} of length 4. The additional rows and columns added to the beginning and ending of each spatial dimension of *input*, [beginning_height, ending_height, beginning_width, ending_width]. If not present, the values are assumed to be [0,0,0,0].
- *strides*: a sequence of {{long}} of length 2. The stride of the sliding window for each spatial dimension of *input*, [stride_height, stride_width]. If not present, the values are assumed to be [1,1].
- *dilations*: a sequence of {{long}} of length 2. The dilation factor for each spatial dimension of *input*, [dilation_height, dilation_width]. If not present, the values are assumed to be [1,1].
- *padding*: a sequence of {{unsigned long}} of length 4. The additional rows and columns added to the beginning and ending of each spatial dimension of *input*, [beginning_height, ending_height, beginning_width, ending_width]. If not present, the values are assumed to be [0,0,0,0].
- *strides*: a sequence of {{unsigned long}} of length 2. The stride of the sliding window for each spatial dimension of *input*, [stride_height, stride_width]. If not present, the values are assumed to be [1,1].
- *dilations*: a sequence of {{unsigned long}} of length 2. The dilation factor for each spatial dimension of *input*, [dilation_height, dilation_width]. If not present, the values are assumed to be [1,1].
- *autoPad*: an {{MLAutoPad}}. The automatic input padding options. By default, this argument is set to *"explicit"*, which means that the values in the *options.padding* array should be used for input padding. When the option is set other than *"explicit"*, the values in the *options.padding* array are ignored. With the *"same-upper"* option, the padding values are automatically computed such that the additional ending padding of the spatial input dimensions would allow all of the input values in the corresponding dimension to be filtered. The *"same-lower"* option is similar but padding is applied to the beginning padding of the spatial input dimensions instead of the ending one.
- *groups*: a {{long}} scalar. The number of groups that input channels and output channels are divided into, default to 1.
- *groups*: an {{unsigned long}} scalar. The number of groups that input channels and output channels are divided into, default to 1.
- *inputLayout*: an {{MLInputOperandLayout}}. The default value is *"nchw"*. This option specifies the layout format of the input and output tensor as follow:

"nchw":
Expand Down Expand Up @@ -1134,13 +1134,13 @@ enum MLConvTranspose2dFilterOperandLayout {
};

dictionary MLConvTranspose2dOptions {
sequence<long> padding;
sequence<long> strides;
sequence<long> dilations;
sequence<long> outputPadding;
sequence<long> outputSizes;
sequence<unsigned long> padding;
sequence<unsigned long> strides;
sequence<unsigned long> dilations;
sequence<unsigned long> outputPadding;
sequence<unsigned long> outputSizes;
MLAutoPad autoPad = "explicit";
long groups = 1;
unsigned long groups = 1;
MLInputOperandLayout inputLayout = "nchw";
MLConvTranspose2dFilterOperandLayout filterLayout = "iohw";
MLOperand bias;
Expand All @@ -1159,13 +1159,13 @@ partial interface MLGraphBuilder {
- *filter*: an {{MLOperand}}. The filter 4-D tensor. The logical shape is
interpreted according to the value of *options.filterLayout* and *options.groups*.
- *options*: an optional {{MLConvTranspose2dOptions}}. The optional parameters of the operation.
- *padding*: a sequence of {{long}} of length 4. The additional rows and columns added to the beginning and ending of each spatial dimension of *input*, [beginning_height, ending_height, beginning_width, ending_width]. If not present, the values are assumed to be [0,0,0,0].
- *strides*: a sequence of {{long}} of length 2. The stride of the sliding window for each spatial dimension of *input*, [stride_height, stride_width]. If not present, the values are assumed to be [1,1].
- *dilations*: a sequence of {{long}} of length 2. The dilation factor for each spatial dimension of *input*, [dilation_height, dilation_width]. If not present, the values are assumed to be [1,1].
- *outputPadding*: a sequence of {{long}} of length 2. The padding values applied to each spatial dimension of the output tensor. This explicit padding values are needed to disambiguate the output tensor shape for transposed convolution when the value of the *options.strides* is greater than 1. Note that these values are only used to disambiguate output shape when needed; it does not necessarily cause any padding value to be written to the output tensor. If not specified, the values are assumed to be [0,0].
- *outputSizes*: a sequence of {{long}} of length 2. The sizes of the last two dimensions of the output tensor. When the output sizes are explicitly specified, the output padding values in *options.outputPadding* are ignored. If not specified, the output sizes are automatically computed.
- *padding*: a sequence of {{unsigned long}} of length 4. The additional rows and columns added to the beginning and ending of each spatial dimension of *input*, [beginning_height, ending_height, beginning_width, ending_width]. If not present, the values are assumed to be [0,0,0,0].
- *strides*: a sequence of {{unsigned long}} of length 2. The stride of the sliding window for each spatial dimension of *input*, [stride_height, stride_width]. If not present, the values are assumed to be [1,1].
- *dilations*: a sequence of {{unsigned long}} of length 2. The dilation factor for each spatial dimension of *input*, [dilation_height, dilation_width]. If not present, the values are assumed to be [1,1].
- *outputPadding*: a sequence of {{unsigned long}} of length 2. The padding values applied to each spatial dimension of the output tensor. This explicit padding values are needed to disambiguate the output tensor shape for transposed convolution when the value of the *options.strides* is greater than 1. Note that these values are only used to disambiguate output shape when needed; it does not necessarily cause any padding value to be written to the output tensor. If not specified, the values are assumed to be [0,0].
- *outputSizes*: a sequence of {{unsigned long}} of length 2. The sizes of the last two dimensions of the output tensor. When the output sizes are explicitly specified, the output padding values in *options.outputPadding* are ignored. If not specified, the output sizes are automatically computed.
- *autoPad*: an {{MLAutoPad}}. The automatic input padding options. By default, this argument is set to *"explicit"*, which means that the values in the *options.padding* array should be used for input padding. When the option is set other than *"explicit"*, the values in the *options.padding* array are ignored. With the *"same-upper"* option, the padding values are automatically computed such that the additional ending padding of the spatial input dimensions would allow all of the input values in the corresponding dimension to be filtered. The *"same-lower"* option is similar but padding is applied to the beginning padding of the spatial input dimensions instead of the ending one.
- *groups*: a {{long}} scalar. The number of groups that input channels and output channels are divided into, default to 1.
- *groups*: an {{unsigned long}} scalar. The number of groups that input channels and output channels are divided into, default to 1.
- *inputLayout*: an {{MLInputOperandLayout}}. The default value is *"nchw"*. This option specifies the layout format of the input and output tensor as follow:

"nchw":
Expand Down Expand Up @@ -1909,14 +1909,14 @@ enum MLRoundingType {
};

dictionary MLPool2dOptions {
sequence<long> windowDimensions;
sequence<long> padding;
sequence<long> strides;
sequence<long> dilations;
sequence<unsigned long> windowDimensions;
sequence<unsigned long> padding;
sequence<unsigned long> strides;
sequence<unsigned long> dilations;
MLAutoPad autoPad = "explicit";
MLInputOperandLayout layout = "nchw";
MLRoundingType roundingType = "floor";
sequence<long> outputSizes;
sequence<unsigned long> outputSizes;
};

partial interface MLGraphBuilder {
Expand All @@ -1930,14 +1930,14 @@ partial interface MLGraphBuilder {
- *input*: an {{MLOperand}}. The input 4-D tensor. The logical shape
is interpreted according to the value of *options.layout*.
- *options*: an optional {{MLPool2dOptions}}. The optional parameters of the operation.
- *windowDimensions*: a sequence of {{long}} of length 2. The dimensions of the sliding window,
- *windowDimensions*: a sequence of {{unsigned long}} of length 2. The dimensions of the sliding window,
[window_height, window_width]. If not present, the window dimensions are assumed to be the height
and width dimensions of the input shape.
- *padding*: a sequence of {{long}} of length 4. The additional rows and columns added to the beginning and ending of each spatial dimension of *input*, [beginning_height, ending_height, beginning_width, ending_width]. If not present, the values are assumed to be [0,0,0,0].
- *strides*: a sequence of {{long}} of length 2. The stride of the
- *padding*: a sequence of {{unsigned long}} of length 4. The additional rows and columns added to the beginning and ending of each spatial dimension of *input*, [beginning_height, ending_height, beginning_width, ending_width]. If not present, the values are assumed to be [0,0,0,0].
- *strides*: a sequence of {{unsigned long}} of length 2. The stride of the
sliding window for each spatial dimension of *input*,
[stride_height, stride_width]. If not present, the values are assumed to be [1,1].
- *dilations*: a sequence of {{long}} of length 2. The dilation factor
- *dilations*: a sequence of {{unsigned long}} of length 2. The dilation factor
for each spatial dimension of *input*, [dilation_height, dilation_width].
If not present, the values are assumed to be [1,1].
- *autoPad*: an {{MLAutoPad}}. The automatic input padding options. By default, this argument is set to *"explicit"*, which means that the values in the *options.padding* array should be used for input padding. When the option is set other than *"explicit"*, the values in the *options.padding* array are ignored. With the *"same-upper"* option, the padding values are automatically computed such that the additional ending padding of the spatial input dimensions would allow all of the input values in the corresponding dimension to be filtered. The *"same-lower"* option is similar but padding is applied to the beginning padding of the spatial input dimensions instead of the ending one.
Expand All @@ -1952,7 +1952,7 @@ partial interface MLGraphBuilder {
- input tensor: [batches, height, width, channels]
- output tensor: [batches, height, width, channels]
- *roundingType*: an {{MLRoundingType}}. The option specifies the rounding function used to compute the output shape.
- *outputSizes*: a sequence of long of length 2. The sizes of the two spacial dimensions of the output tensor. When the output sizes are explicitly specified, the options.roundingType is ignored. If not specified, the output sizes are automatically computed.
- *outputSizes*: a sequence of {{unsigned long}} of length 2. The sizes of the two spacial dimensions of the output tensor. When the output sizes are explicitly specified, the options.roundingType is ignored. If not specified, the output sizes are automatically computed.

**Returns:** an {{MLOperand}}. The output 4-D tensor that contains the
result of the reduction. The logical shape is interpreted according to the
Expand Down