AveragePool - 10 vs 11#

Next section compares an older to a newer version of the same operator after both definition are converted into markdown text. Green means an addition to the newer version, red means a deletion. Anything else is unchanged.

Files changed (1) hide show
  1. AveragePool10 → AveragePool11 +5 -8
AveragePool10 → AveragePool11 RENAMED
@@ -1 +1 @@
1
1
  AveragePool consumes an input tensor X and applies average pooling across
2
2
  the tensor according to kernel sizes, stride sizes, and pad lengths.
3
3
  average pooling consisting of computing the average on all values of a
4
4
  subset of the input tensor according to the kernel size and downsampling the
5
5
  data into the output tensor Y for further processing. The output spatial shape will be following:
6
6
  ::
7
7
  output_spatial_shape[i] = floor((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)
8
8
  or
9
9
  ::
10
10
  output_spatial_shape[i] = ceil((input_spatial_shape[i] + pad_shape[i] - kernel_spatial_shape[i]) / strides_spatial_shape[i] + 1)
11
11
  if ceil_mode is enabled
12
12
  ::
13
13
  * pad_shape[i] is sum of pads along axis i
14
14
  auto_pad is a DEPRECATED attribute. If you are using them currently, the output spatial shape will be following:
15
15
  ::
16
16
  VALID: output_spatial_shape[i] = ceil((input_spatial_shape[i] - kernel_spatial_shape[i] + 1) / strides_spatial_shape[i])
17
17
  SAME_UPPER or SAME_LOWER: output_spatial_shape[i] = ceil(input_spatial_shape[i] / strides_spatial_shape[i])
18
18
  And pad shape will be following if SAME_UPPER or SAME_LOWER:
19
19
  ::
20
20
  pad_shape[i] = (output_spatial_shape[i] - 1) * strides_spatial_shape[i] + kernel_spatial_shape[i] - input_spatial_shape[i]
21
21
  The output of each pooling window is divided by the number of elements (exclude pad when attribute count_include_pad is zero).
22
22
  **Attributes**
23
23
  * **auto_pad**:
24
24
  auto_pad must be either NOTSET, SAME_UPPER, SAME_LOWER or VALID.
25
25
  Where default value is NOTSET, which means explicit padding is used.
26
- SAME_UPPER or SAME_LOWER mean pad the input so that output_shape[i]
26
+ SAME_UPPER or SAME_LOWER mean pad the input so that the output
27
+ spatial size match the input.In case of odd number add the extra
28
+ padding at the end for SAME_UPPER and at the beginning for
29
+ SAME_LOWER. VALID mean no padding.
27
- = ceil(input_shape[i] / strides[i]) for each axis i. The padding
28
- is split between the two sides equally or almost equally (depending
29
- on whether it is even or odd). In case the padding is an odd number,
30
- the extra padding is added at the end for SAME_UPPER and at the
31
- beginning for SAME_LOWER.
32
30
  * **ceil_mode**:
33
31
  Whether to use ceil or floor (default) to compute the output shape.
34
32
  * **count_include_pad**:
35
33
  Whether include pad pixels when calculating values for the edges.
36
34
  Default is 0, doesn't count include pad.
37
35
  * **kernel_shape** (required):
38
36
  The size of the kernel along each axis.
39
37
  * **pads**:
40
38
  Padding for the beginning and ending along each spatial axis, it can
41
39
  take any value greater than or equal to 0. The value represent the
42
40
  number of pixels added to the beginning and end part of the
43
41
  corresponding axis. pads format should be as follow [x1_begin,
44
42
  x2_begin...x1_end, x2_end,...], where xi_begin the number of pixels
45
43
  added at the beginning of axis i and xi_end, the number of pixels
46
44
  added at the end of axis i. This attribute cannot be used
47
45
  simultaneously with auto_pad attribute. If not present, the padding
48
46
  defaults to 0 along start and end of each spatial axis.
49
47
  * **strides**:
50
- Stride along each spatial axis. If not present, the stride defaults
51
- to 1 along each spatial axis.
48
+ Stride along each spatial axis.
52
49
  **Inputs**
53
50
  * **X** (heterogeneous) - **T**:
54
51
  Input data tensor from the previous operator; dimensions for image
55
52
  case are (N x C x H x W), where N is the batch size, C is the number
56
53
  of channels, and H and W are the height and the width of the data.
57
54
  For non image case, the dimensions are in the form of (N x C x D1 x
58
55
  D2 ... Dn), where N is the batch size. Optionally, if dimension
59
56
  denotation is in effect, the operation expects the input data tensor
60
57
  to arrive with the dimension denotation of [DATA_BATCH,
61
58
  DATA_CHANNEL, DATA_FEATURE, DATA_FEATURE ...].
62
59
  **Outputs**
63
60
  * **Y** (heterogeneous) - **T**:
64
61
  Output data tensor from average or max pooling across the input
65
62
  tensor. Dimensions will vary based on various kernel, stride, and
66
63
  pad sizes. Floor value of the dimension is used
67
64
  **Type Constraints**
68
65
  * **T** in (
69
66
  tensor(double),
70
67
  tensor(float),
71
68
  tensor(float16)
72
69
  ):
73
70
  Constrain input and output types to float tensors.