-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ONNX] [Relay] Resize Opset 13 #9265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -3970,6 +3970,12 @@ def verify(ishape, oshape, scales, mode, coord_trans="asymmetric", alpha=0.5, ex | |||
make_constant_node("scales", onnx.TensorProto.FLOAT, (len(scales),), scales), | |||
] | |||
input_names = ["X", "roi", "scales"] | |||
|
|||
# if scales == []: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove this if you don't need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the commented code, otherwise LGTM, thanks!
@classmethod | ||
def v11_13_common(cls, inputs, size, attr, params): | ||
""" | ||
Resize v11 and Resize v13 are identical except in how |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resize v11 and resize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi emijiayw, Thanks for your feedback! Resize v13 is specified for clarity since just resize could be misleading. :)
python/tvm/relay/frontend/onnx.py
Outdated
def v11_13_common(cls, inputs, size, attr, params): | ||
""" | ||
Resize v11 and Resize v13 are identical except in how | ||
they handle passing in scale and size. This utility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they handle the passing
scale = inputs[2] | ||
size = inputs[3] | ||
if size is not None: | ||
assert scale is None, "One of scale or size should be passed, not both." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the scales or sizes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both scale and size are singular (there is only one of them) and adding an 's' makes them plural. It's only one dog or cat, not dogs or cats 🐶 🐈 vs 🐶 🐶 🐶 🐈 🐈 🐈
), "One of scale or size should be passed, not both." | ||
size = inputs[3] | ||
else: | ||
assert len(scale_shape) != 0, "One of scale or size should be passed." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the scales or sizes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above!
* Fix handling of optional inputs. * Missed one test in the ignore list. * split 11 and 13 * removed comments, adjusted for git review Co-authored-by: Josh Fromm <jwfromm@uw.edu> Co-authored-by: Matthew <mbrookhart@octoml.ai> Co-authored-by: CircleSpin <jocelyn@pop-os.localdomain>
* Fix handling of optional inputs. * Missed one test in the ignore list. * split 11 and 13 * removed comments, adjusted for git review Co-authored-by: Josh Fromm <jwfromm@uw.edu> Co-authored-by: Matthew <mbrookhart@octoml.ai> Co-authored-by: CircleSpin <jocelyn@pop-os.localdomain>
* Fix handling of optional inputs. * Missed one test in the ignore list. * split 11 and 13 * removed comments, adjusted for git review Co-authored-by: Josh Fromm <jwfromm@uw.edu> Co-authored-by: Matthew <mbrookhart@octoml.ai> Co-authored-by: CircleSpin <jocelyn@pop-os.localdomain>
@mbrookhart @AndrewZhaoLuo @anwang2009