Skip to content

[Onnx] [EZ] Fix reshape bug with passing both scale and size - #9512

Closed
AndrewZhaoLuo wants to merge 2 commits into
apache:mainfrom
AndrewZhaoLuo:aluo/onnx/fix-resize-checking
Closed

[Onnx] [EZ] Fix reshape bug with passing both scale and size#9512
AndrewZhaoLuo wants to merge 2 commits into
apache:mainfrom
AndrewZhaoLuo:aluo/onnx/fix-resize-checking

Conversation

@AndrewZhaoLuo

Copy link
Copy Markdown
Contributor

Resize can either take a scale or size parameter describing how the resize operation can be performed. Both cannot be given and we throw an error if they are. However, we assume if size is present then scale is none. This is not exhaustive as sometimes it seems that an empty sequence is also sufficient for this.

See the previous opset implementations for Resize to see this case.

@comaniac comaniac left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. Could you check whether other frontends have this issue as well?

Comment thread python/tvm/relay/frontend/onnx.py Outdated
Co-authored-by: Cody Yu <comaniac0422@gmail.com>
def _impl_v13(cls, inputs, attr, params):
scale = inputs[2]
size = inputs[3]
scale_type = infer_type(scale)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will crash if scale is None?

@AndrewZhaoLuo

Copy link
Copy Markdown
Contributor Author

This will be subsumed by #9475

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants