diff options
author | Eric Kunze <eric.kunze@arm.com> | 2020-11-09 13:37:12 -0800 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2020-11-10 19:26:12 +0000 |
commit | 7d3d6d28fa5ea03aa68071e488d1176311cf8b50 (patch) | |
tree | 39cb57589fd721ee53d99399cd66dcdfd9c6fe3e | |
parent | 4ee64650102977d2a6962b4ee5924e418da024cf (diff) | |
download | specification-7d3d6d28fa5ea03aa68071e488d1176311cf8b50.tar.gz |
Update RESIZE description
Try to make the different modes clearer, especially the
integer BILINEAR mode.
Change-Id: I6a2ab6ee4ed9e6a76d13bec4498e213a7f20b91f
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
-rw-r--r-- | chapters/image.adoc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/chapters/image.adoc b/chapters/image.adoc index f1b3a92..e8b2917 100644 --- a/chapters/image.adoc +++ b/chapters/image.adoc @@ -11,7 +11,25 @@ ==== RESIZE -Resizes a tensor. Resize is only allowed in the H and W dimensions. In expected use, stride_y is approximately (IH<<shift)/OH and stride_x is approximately (IW<<shift)/OW. OH and OW are also supplied as inputs since there may be off by one errors if calculating OH and OW from the strides. +Resizes a tensor. Resize is only allowed in the H and W dimensions. + +The NEAREST_NEIGHBOR mode returns the value of the input tensor closest to the +calculated sample position for both floating point and integer data formats. + +Floating point BILINEAR mode returns a bilinearly interpolated output value +based on the four closest input sample positions. + +For integer BILINEAR interpolation mode, the output value is calculated by using +the shift value along with the other parameters to create a fixed point scaling +factor for each input. These values are then summed to create the value for +output, which has 2 * shift fractional bits. To convert back to the original +integer size, the output value must be rescaled. + +For floating point stride, stride_y should be set to IH/OH, stride_x should be +set to IW/OW. When using integer stride, stride_y is approximately +(IH<<shift)/OH and stride_x is approximately (IW<<shift)/OW. OH and OW are also +supplied as inputs since there may be off by one errors if calculating OH and OW +from the strides. *Arguments:* |