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

Register shape functions for some image related ops #6373

Merged
merged 9 commits into from
Nov 4, 2020

Conversation

Laurawly
Copy link
Contributor

@Laurawly Laurawly commented Sep 1, 2020

Added shape functions for image.resize, image.grid_sample and image.affine_grid

@icemelon9 Could you please review?

@Laurawly Laurawly changed the title Add shape functions Register shape functions for some image related ops Sep 1, 2020
python/tvm/relay/op/image/_image.py Outdated Show resolved Hide resolved
python/tvm/relay/op/image/_image.py Outdated Show resolved Hide resolved
python/tvm/relay/op/image/_image.py Outdated Show resolved Hide resolved
out = output_tensor((4,), "int64")
out[0] = int64(data[0])
out[1] = int64(2)
out[2] = int64(target_shape[0])
Copy link
Member

Choose a reason for hiding this comment

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

do we support different layout for affine_grid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No I don't think so.

out[0] = int64(data[0])
out[1] = int64(data[1])
out[2] = int64(grid[2])
out[3] = int64(grid[3])
Copy link
Member

Choose a reason for hiding this comment

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

same question here. different layout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I think it only supports NCHW

@tqchen tqchen changed the base branch from master to main October 11, 2020 18:20
@tqchen
Copy link
Member

tqchen commented Oct 28, 2020

ping @Laurawly @icemelon9 please follow up

Copy link
Member

@icemelon icemelon left a comment

Choose a reason for hiding this comment

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

LGTM. Please resolve the conflict

y = relay.image.resize(data, size, layout)
mod["main"] = relay.Function([data], y)
data_np = np.random.uniform(size=static_data_shape).astype(dtype)
for kind in ["debug", "vm"]:
Copy link
Member

Choose a reason for hiding this comment

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

BTW, this has been moved to test_result and you may want to annotate the test with @tvm.testing.uses_gpu if gpu is supported

@Laurawly Laurawly force-pushed the shape_func branch 2 times, most recently from 6a6fda5 to 4441338 Compare November 2, 2020 07:40
@Laurawly Laurawly merged commit 237744d into apache:main Nov 4, 2020
@Laurawly Laurawly deleted the shape_func branch November 4, 2020 04:57
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
* debugging

* added three shape funcs

* fix lint

* address comment

* resolve conflicts

* resolve conflicts

* resolve conflicts

* resolve conflicts

* resolve conflicts
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
* debugging

* added three shape funcs

* fix lint

* address comment

* resolve conflicts

* resolve conflicts

* resolve conflicts

* resolve conflicts

* resolve conflicts
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
* debugging

* added three shape funcs

* fix lint

* address comment

* resolve conflicts

* resolve conflicts

* resolve conflicts

* resolve conflicts

* resolve conflicts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants