Resize - 11 vs 13

Files changed (1) hide show
  1. Resize11 → Resize13 +10 -9
Resize11 → Resize13 RENAMED
@@ -1 +1 @@
1
1
  Resize the input tensor. In general, it calculates every value in the output tensor as a weighted average of neighborhood (a.k.a. sampling locations) in the input tensor.
2
2
  Each dimension value of the output tensor is:
3
3
  output_dimension = floor(input_dimension * (roi_end - roi_start) * scale) if input "sizes" is not specified.
4
4
  **Attributes**
5
5
  * **coordinate_transformation_mode**:
6
6
  This attribute describes how to transform the coordinate in the
7
7
  resized tensor to the coordinate in the original tensor. <br/> The
8
8
  coordinate of each dimension is transformed individually. Let's
9
9
  describe a case using axis x as an example. Denote x_resized as the
10
10
  coordinate of axis x in the resized tensor, x_original as the
11
11
  coordinate of axis x in the original tensor, length_original as the
12
12
  length of the original tensor in axis x, length_resized as the
13
13
  length of the resized tensor in axis x, roi_x = (start_x, end_x) of
14
14
  the axis x in input "roi", scale = length_resized / length_original,
15
15
  <br/> if coordinate_transformation_mode is "half_pixel", <br/>
16
16
  x_original = (x_resized + 0.5) / scale - 0.5, <br/> if
17
17
  coordinate_transformation_mode is "pytorch_half_pixel", <br/>
18
18
  x_original = length_resized > 1 ? (x_resized + 0.5) / scale - 0.5 :
19
19
  0, <br/> if coordinate_transformation_mode is "align_corners",
20
20
  <br/> x_original = x_resized * (length_original - 1) /
21
21
  (length_resized - 1), <br/> if coordinate_transformation_mode is
22
22
  "asymmetric", <br/> x_original = x_resized / scale, <br/> if
23
- coordinate_transformation_mode is "tf_half_pixel_for_nn", <br/>
24
- x_original = (x_resized + 0.5) / scale, <br/> if
25
23
  coordinate_transformation_mode is "tf_crop_and_resize", <br/>
26
24
  x_original = length_resized > 1 ? start_x * (length_original - 1) +
27
25
  x_resized * (end_x - start_x) * (length_original - 1) /
28
26
  (length_resized - 1) : 0.5 * (start_x + end_x) * (length_original -
29
27
  1).
30
28
  * **cubic_coeff_a**:
31
29
  The coefficient 'a' used in cubic interpolation. Two common choice
32
30
  are -0.5 (in some cases of TensorFlow) and -0.75 (in PyTorch). Check
33
31
  out Equation (4) in https://ieeexplore.ieee.org/document/1163711 for
34
32
  the details. This attribute is valid only if "mode" is "cubic".
35
33
  * **exclude_outside**:
36
34
  If set to 1, the weight of sampling locations outside the tensor
37
35
  will be set to 0 and the weight will be renormalized so that their
38
36
  sum is 1.0. The default value is 0.
39
37
  * **extrapolation_value**:
40
38
  When coordinate_transformation_mode is "tf_crop_and_resize" and
41
39
  x_original is outside the range [0, length_original - 1], this value
42
40
  is used as the corresponding output value. Default is 0.0f.
43
41
  * **mode**:
44
42
  Three interpolation modes: nearest (default), linear and cubic. The
45
43
  "linear" mode includes linear interpolation for 1D tensor and
46
44
  N-linear interpolation for N-D tensor (for example, bilinear
47
45
  interpolation for 2D tensor). The "cubic" mode includes cubic
48
46
  interpolation for 1D tensor and N-cubic interpolation for N-D tensor
49
47
  (for example, bicubic interpolation for 2D tensor).
50
48
  * **nearest_mode**:
51
49
  Four modes: round_prefer_floor (default, as known as round half
52
50
  down), round_prefer_ceil (as known as round half up), floor, ceil.
53
51
  Only used by nearest interpolation. It indicates how to get
54
52
  "nearest" pixel in input tensor from x_original, so this attribute
55
53
  is valid only if "mode" is "nearest".
56
54
  **Inputs**
57
- Between 3 and 4 inputs.
55
+ Between 1 and 4 inputs.
58
56
  * **X** (heterogeneous) - **T1**:
59
57
  N-D tensor
60
- * **roi** (heterogeneous) - **T2**:
58
+ * **roi** (optional, heterogeneous) - **T2**:
61
59
  1-D tensor given as [start1, ..., startN, end1, ..., endN], where N
62
60
  is the rank of X. The RoIs' coordinates are normalized in the
63
61
  coordinate system of the input image. It only takes effect when
64
62
  coordinate_transformation_mode is "tf_crop_and_resize"
65
- * **scales** (heterogeneous) - **tensor(float)**:
63
+ * **scales** (optional, heterogeneous) - **tensor(float)**:
66
64
  The scale array along each dimension. It takes value greater than 0.
67
65
  If it's less than 1, it's sampling down, otherwise, it's upsampling.
68
66
  The number of elements of 'scales' should be the same as the rank of
69
- input 'X'. If 'size' is needed, the user must set 'scales' to an
67
+ input 'X'. One of 'scales' and 'sizes' MUST be specified and it is
68
+ an error if both are specified. If 'sizes' is needed, the user can
69
+ use an empty string as the name of 'scales' in this operator's input
70
- empty tensor.
70
+ list.
71
71
  * **sizes** (optional, heterogeneous) - **tensor(int64)**:
72
72
  The size of the output tensor. The number of elements of 'sizes'
73
- should be the same as the rank of input 'X'. May only be set if
73
+ should be the same as the rank of input 'X'. Only one of 'scales'
74
- 'scales' is set to an empty tensor.
74
+ and 'sizes' can be specified.
75
75
  **Outputs**
76
76
  * **Y** (heterogeneous) - **T1**:
77
77
  N-D tensor after resizing
78
78
  **Type Constraints**
79
79
  * **T1** in (
80
+ tensor(bfloat16),
80
81
  tensor(bool),
81
82
  tensor(complex128),
82
83
  tensor(complex64),
83
84
  tensor(double),
84
85
  tensor(float),
85
86
  tensor(float16),
86
87
  tensor(int16),
87
88
  tensor(int32),
88
89
  tensor(int64),
89
90
  tensor(int8),
90
91
  tensor(string),
91
92
  tensor(uint16),
92
93
  tensor(uint32),
93
94
  tensor(uint64),
94
95
  tensor(uint8)
95
96
  ):
96
97
  Constrain input 'X' and output 'Y' to all tensor types.
97
98
  * **T2** in (
98
99
  tensor(double),
99
100
  tensor(float),
100
101
  tensor(float16)
101
102
  ):
102
103
  Constrain roi type to float or double.