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

[Relay] [Op] Squeeze #1858

Merged
merged 2 commits into from Oct 15, 2018
Merged

[Relay] [Op] Squeeze #1858

merged 2 commits into from Oct 15, 2018

Conversation

MarisaKirisame
Copy link
Contributor

Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from others in the community.

struct SqueezeAttrs : public tvm::AttrsNode<SqueezeAttrs> {
Array<IndexExpr> axis;

TVM_DECLARE_ATTRS(ExpandDimsAttrs, "relay.attrs.ExpandDimsAttrs") {
Copy link
Member

Choose a reason for hiding this comment

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

wrong name: ExpandDimAttrs

@tqchen
Copy link
Member

tqchen commented Oct 8, 2018

@joshpoll @siju-samuel @junrushao1994 please review

@junrushao
Copy link
Member

Will do tmr morning

"""
axes = axes or []
return _make.transpose(data, list(axes))


def squeeze(data, axes=None):
"""Remove the axis that equals to 1 in an array
Copy link
Member

Choose a reason for hiding this comment

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

Can rephrase to "Squeeze axes in the array."

}

RELAY_REGISTER_OP("squeeze")
.describe(R"code(squeeze the input tensor at the dimensions given by `axis`
Copy link
Member

Choose a reason for hiding this comment

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

Squeeze the input tensor at the dimensions given by axes

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

Please improve the error message, other parts look good

src/relay/op/tensor/transform.cc Outdated Show resolved Hide resolved
@tqchen tqchen added the status: need update need update based on feedbacks label Oct 8, 2018
include/tvm/relay/attrs/transform.h Outdated Show resolved Hide resolved
include/tvm/relay/attrs/transform.h Outdated Show resolved Hide resolved
include/tvm/relay/attrs/transform.h Outdated Show resolved Hide resolved
python/tvm/relay/op/transform.py Outdated Show resolved Hide resolved
python/tvm/relay/op/transform.py Show resolved Hide resolved
src/relay/op/tensor/transform.cc Show resolved Hide resolved
tests/python/relay/test_op_level3.py Show resolved Hide resolved
@MarisaKirisame
Copy link
Contributor Author

@tqchen can you give it another look? I had addressed all comment.

@tqchen tqchen merged commit 201cfdc into apache:master Oct 15, 2018
@tqchen tqchen added status: accepted and removed status: need update need update based on feedbacks labels Oct 15, 2018
@MarisaKirisame MarisaKirisame deleted the squeeze branch October 15, 2018 17:14
FrozenGene pushed a commit to FrozenGene/tvm that referenced this pull request Dec 27, 2018
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.

None yet

5 participants