JR4er opened a new pull request, #16137:
URL: https://github.com/apache/tvm/pull/16137

   "resize" result can be wrong if method="nearest_neighbor" and 
coordinate_transformation_mode="asymmetric" and rounding_method != "floor" and 
target_height, target_width = n * image_height, m * image_width (n,m are 
integers).
   
   #12567 
   
   in buggy implementation:
   `can_convert_multiply_to_intdiv` returns `True` if `scaled_size`  is n times 
`origin_size`, which will result in that `get_closest_index` converts the 
mapped coordinate by `astype('int32')` without checking `rounding_method`.
   
   in this implementation:
   `can_convert_multiply_to_intdiv` returns `True` if `origin_size` is n times 
`scaled_size`, which means that any coordinate in target_image will be mapped 
into an integer coordinate in the origin_image. Therefore `get_closest_index` 
do the `astype(`int32`)` in correct scenario.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to