@@ -169,12 +169,18 @@ def CenterCropPad(
169169
170170 Center crop or pad an input to given dimensions.
171171
172- The crop/pad dimensions can be specified for a subset of the `axes`. Non-specified dimensions will not be
173- cropped or padded.
172+ The crop/pad dimensions can be specified for a subset of the `axes`; unspecified dimensions will remain unchanged.
174173
175- If the input dimensions are bigger than the crop shape, a centered cropping window is extracted from the input.
176- If the input dimensions are smaller than the crop shape, the input is padded on each side equally,
177- so that the input is centered in the output.
174+ If the input dimensions are larger than the target crop dimensions, a centered cropping window will be extracted
175+ from the input. The starting value for the cropping window is rounded down, which means that if the difference
176+ between the input shape and the crop shape is odd, the cropping window will be shifted half a pixel to the left
177+ of the input center.
178+
179+ If the input dimensions are smaller than the target crop dimensions, the input will be padded equally on both sides
180+ to center it in the output. In cases where the total number of padding pixels is odd, an additional pixel will be
181+ added to the right side.
182+
183+ The padding value used is zero.
178184
179185
180186 Args:
@@ -286,65 +292,6 @@ def Col2Im(
286292 strides = strides ,
287293 )
288294
289- T_GroupNormalization = TypeVar ("T_GroupNormalization" , BFLOAT16 , DOUBLE , FLOAT , FLOAT16 )
290-
291- def GroupNormalization (
292- self ,
293- X : T_GroupNormalization ,
294- scale : T_GroupNormalization ,
295- bias : T_GroupNormalization ,
296- * ,
297- epsilon : float = 9.999999747378752e-06 ,
298- num_groups : int ,
299- ) -> T_GroupNormalization :
300- r"""[🌐 GroupNormalization(18)](https://onnx.ai/onnx/operators/onnx__GroupNormalization.html#groupnormalization-18 "Online Documentation")
301-
302-
303- A GroupNormalization function. Carries out group normalization as described in
304- the paper https://arxiv.org/abs/1803.08494
305-
306- This operator transforms input according to
307- ::
308-
309- y = scale * (x - mean) / sqrt(variance + epsilon) + bias,
310-
311-
312- where the mean and variance are computed per instance per group of channels, and
313- `scale` and `bias` should be specified for each group of channels. The number of
314- groups `num_groups` should be divisible by the number of channels so that there are
315- an equal number of channels per group.
316-
317- When the number of groups is the same as the number of channels, this operator is
318- equivalent to InstanceNormalization. When there is only one group, this operator
319- is equivalent to LayerNormalization.
320-
321-
322- Args:
323- X: (differentiable) Input data tensor. Dimensions for image cases are `(N x
324- C x H x W)`, where `N` is the batch size, `C` is the number of channels,
325- and `H` and `W` are the height and width of the data. Statistics are
326- computed for every group of channels over `C`, `H`, and `W`. For
327- non-image cases, the dimensions are in the form of `(N x C x D1 x D2 ...
328- Dn)`.
329-
330- scale: (differentiable) Scale tensor of shape `(num_groups)`.
331-
332- bias: (differentiable) Bias tensor of shape `(num_groups)`.
333-
334- epsilon: The epsilon value to use to avoid division by zero.
335-
336- num_groups: The number of groups of channels. It should be a divisor of the
337- number of channels `C`.
338- """
339-
340- schema = get_schema ("GroupNormalization" , 18 , "" )
341- op = Op (self , "GroupNormalization" , schema )
342- return op (
343- * self ._prepare_inputs (schema , X , scale , bias ),
344- epsilon = epsilon ,
345- num_groups = num_groups ,
346- )
347-
348295 T_LpPool = TypeVar ("T_LpPool" , DOUBLE , FLOAT , FLOAT16 )
349296
350297 def LpPool (
0 commit comments