Skip to content
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

Reshape does not check that shape change is valid #6210

Closed
tkonolige opened this issue Aug 4, 2020 · 4 comments · Fixed by #6215
Closed

Reshape does not check that shape change is valid #6210

tkonolige opened this issue Aug 4, 2020 · 4 comments · Fixed by #6215

Comments

@tkonolige
Copy link
Contributor

This following code snippet causes zero errors. Running this module with the graph runtime also does not error.

from tvm import relay
x = relay.var("x", shape=[2,3])
y = relay.reshape(x, [7])
f = relay.Function([x], y)
mod = relay.build(f, target="llvm")

@tqchen

@tkonolige
Copy link
Contributor Author

@mbrookhart

@mbrookhart
Copy link
Contributor

I see that the Shape relation function indeed fails to check for a valid reshape. I'm kind of surprised that running it doesn't crash. What value does the 7th element of the output have?

@mbrookhart
Copy link
Contributor

Doesn't look like the recent dynamic work removed a check, I'll spend some time tomorrow to see if we can add one to the shape relation function.

@tkonolige
Copy link
Contributor Author

@mbrookhart I figured out how to add a shape check to reshape. I will submit the PR tomorrow.

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 a pull request may close this issue.

2 participants