locnd182644 opened a new pull request, #18691:
URL: https://github.com/apache/tvm/pull/18691
This PR fix ROI values when tensor ROI is Empty pass Constant node in Resize
Operator
### Description:
- Fix ROI values when tensor ROI is Empty pass Constant node
- Create test with Constant and Tensor ROI is Empty
### Step to Reproduce:
- Deploy yolov5n.onnx using TVM. When executing
relax.transform.LegalizeOps() is happen error: "IndexError: list index out of
range" at roi array, because roi = []
- Error log:
> "File ~/Contributes/tvm/python/tvm/topi/image/resize.py:615, in
_resize_2d()
> 608 in_x = x1 * (image_width - 1) + w_scale * x
> 609 else:
> 610 in_x = get_inx(
> 611 x,
> 612 image_width,
> 613 target_width,
> 614 coordinate_transformation_mode,
> --> 615 roi[1],
> 616 roi[3],
> 617 width_use_int_div,
> 618 )
> 619 in_y = get_inx(
> 620 y,
> 621 image_height,
> (...) 626 height_use_int_div,
> 627 )
> 629 if method == "nearest_neighbor":
> IndexError: list index out of range"
- Graph:
<img width="1000" height="500" alt="PR"
src="https://github.com/user-attachments/assets/e112511a-43a4-4555-afc6-e22d62ec095e"
/>
### Resolve:
- On the Frontend, when encountering a case where ROI is constant and ROI is
empty, the handling is the same as when ROI = None (fill in the ROI tensor with
0.0).
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]