[Torch] Support hard_swish op#7174
Merged
Merged
Conversation
Member
masahi
reviewed
Dec 29, 2020
| examples = [torch.rand(8), torch.rand(8, 8), torch.rand(8, 16), torch.rand(1, 1, 8)] | ||
| targets = ["llvm", "cuda"] | ||
| for input in examples: | ||
| verify_trace_model(hard_swish, [input], targets) |
Member
There was a problem hiding this comment.
verify_trace_model is supposed to be used for dynamic models that require VM compilation. Please use verify_model instead.
insop
reviewed
Dec 29, 2020
| def test_hard_swish(): | ||
| examples = [torch.rand(8).float(), torch.rand(8, 10).float(), torch.rand(1, 1, 10).float()] | ||
| for input in examples: | ||
| verify_model(torch.nn.Hardswish().eval(), input_data=input) |
Contributor
There was a problem hiding this comment.
Any reason to drop hard_swish_inplace from previous commit?
Contributor
Author
There was a problem hiding this comment.
hard_swish_inplace is not a pure function. It will change input tensor
Contributor
Author
There was a problem hiding this comment.
I can modify verify_model function
masahi
approved these changes
Dec 29, 2020
Member
|
Thanks @Xuxue1 |
tkonolige
pushed a commit
to tkonolige/incubator-tvm
that referenced
this pull request
Jan 11, 2021
* imp_hardswish * format * fix * hard_swish_inplace test case
TusharKanekiDey
pushed a commit
to TusharKanekiDey/tvm
that referenced
this pull request
Jan 20, 2021
* imp_hardswish * format * fix * hard_swish_inplace test case
trevor-m
pushed a commit
to neo-ai/tvm
that referenced
this pull request
Jan 21, 2021
* imp_hardswish * format * fix * hard_swish_inplace test case
electriclilies
pushed a commit
to electriclilies/tvm
that referenced
this pull request
Feb 18, 2021
* imp_hardswish * format * fix * hard_swish_inplace test case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6897
Support hard_swish op https://pytorch.org/docs/stable/generated/torch.nn.Hardswish.html#torch.nn.Hardswish
please review @masahi