diff options
-rw-r--r-- | chapters/image.adoc | 10 | ||||
-rw-r--r-- | tosa.xml | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/chapters/image.adoc b/chapters/image.adoc index 2c23e79..bcef73f 100644 --- a/chapters/image.adoc +++ b/chapters/image.adoc @@ -89,13 +89,15 @@ for_each(0 <= n < N, 0 <= oy < OH, 0 <= ox < OW; 0 <= c < C) { int32_t x = ox * scale_x_d + offset_x; int16_t iy = floor(y / scale_y_n); int16_t ix = floor(x / scale_x_n); + int16_t ry = y - iy * scale_y_n; // (y % scale_y_n) + int16_t rx = x - ix * scale_x_n; // (x % scale_x_n) if (is_floating_point(resize_t)) { - dy = ((resize_t)y / (resize_t)scale_y_n) - iy; - dx = ((resize_t)x / (resize_t)scale_x_n) - ix; + dy = (resize_t)ry / (resize_t)scale_y_n; + dx = (resize_t)rx / (resize_t)scale_x_n; } else { - dy = y - iy * scale_y_n; - dx = y - ix * scale_x_n; + dy = ry; + dx = rx; } // Note that -1 <= iy < IH and -1 <= ix < IW int16_t iy0 = apply_max(iy, 0); @@ -1886,11 +1886,11 @@ used.</description> <typesupport mode="signed 8, nearest" resize_t="int16_t" in_t="int8_t" out_t="int8_t"/> <typesupport mode="signed 16, bilinear" resize_t="int16_t" in_t="int16_t" out_t="int48_t"/> <typesupport mode="signed 16, nearest" resize_t="int16_t" in_t="int16_t" out_t="int16_t"/> - <typesupport mode="fp16" resize_t="fp16_t" in_t="fp32_t" out_t="fp16_t"> + <typesupport mode="fp16" resize_t="fp16_t" in_t="fp16_t" out_t="fp16_t"> <profile name="MI"/> <profile name="MT"/> </typesupport> - <typesupport mode="bf16" resize_t="fp32_t" in_t="bf16_t" out_t="bf16_t"> + <typesupport mode="bf16" resize_t="bf16_t" in_t="bf16_t" out_t="bf16_t"> <profile name="MI"/> <profile name="MT"/> </typesupport> |