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][TOPI] operator All #3124

Merged
merged 4 commits into from
May 20, 2019
Merged

[Relay][TOPI] operator All #3124

merged 4 commits into from
May 20, 2019

Conversation

yongwww
Copy link
Member

@yongwww yongwww commented Apr 30, 2019

Add op All in TOPI, RELAY and TF frontend, all is used in numpy and tensorflow, need it to support tf model ssd/fast-rcnn/mask-rcnn. I will change it to relay.contrib.all, please suggest if you guys have any thought.

@yzhliu @icemelon9 @Laurawly @zhiics @jroesch @srkreddy1238 @tqchen

@jroesch
Copy link
Member

jroesch commented May 2, 2019

LGTM just waiting on someone with more area expertise.


Example::

data = [[[ True, True, True],
Copy link
Contributor

@kevinthesun kevinthesun May 6, 2019

Choose a reason for hiding this comment

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

Does this operator allow numerical type?We'd better update the doc to reflect this.

Copy link
Member Author

Choose a reason for hiding this comment

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

just allow boolean tensor, have updated the doc

@kevinthesun
Copy link
Contributor

Overall lgtm. A minor comment about doc.


exclude : bool
If `exclude` is true, reduction will be performed on the axes that are
NOT in axis instead.
Copy link
Member

Choose a reason for hiding this comment

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

Fix the indent.

exclude : bool
If `exclude` is true, reduction will be performed on the axes that are
NOT in axis instead.

Copy link
Member

Choose a reason for hiding this comment

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

Could you also add the example in cpp to python as well?

@@ -309,6 +310,7 @@ Level 6 Definitions

Level 10 Definitions
--------------------
.. autofunction:: tvm.relay.all
Copy link
Member

Choose a reason for hiding this comment

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

Let's move all to level 4 op since it's a standard numpy op.

op_res = intrp.evaluate(func)(x_data)
tvm.testing.assert_allclose(op_res.asnumpy(), ref_res, rtol=1e-5)
verify_contrib_all((2, 3, 4), axis=(0,))
verify_contrib_all((2, 3, 4, 5, 6), axis=(2, 3), keepdims=True)
Copy link
Member

Choose a reason for hiding this comment

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

Add axis=None and exclude test case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also axis is negative test cases

* over a given axis
*
* \param data The input tensor
* \param axis The axis to perform logical AND over. If axis is empty, the
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: The axis or axes

op_res = intrp.evaluate(func)(x_data)
tvm.testing.assert_allclose(op_res.asnumpy(), ref_res, rtol=1e-5)
verify_contrib_all((2, 3, 4), axis=(0,))
verify_contrib_all((2, 3, 4, 5, 6), axis=(2, 3), keepdims=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Also axis is negative test cases

@jroesch
Copy link
Member

jroesch commented May 8, 2019

@yongwww what's the status on this?

@jroesch jroesch added the status: need update need update based on feedbacks label May 8, 2019
@yongwww
Copy link
Member Author

yongwww commented May 8, 2019

@jroesch I'm on vacation this week, will update the pr to incorporate comments by this weekend

@tqchen
Copy link
Member

tqchen commented May 20, 2019

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

@icemelon icemelon added status: accepted and removed status: need review status: need update need update based on feedbacks labels May 20, 2019
@icemelon icemelon merged commit 9fd8e3c into apache:master May 20, 2019
@icemelon
Copy link
Member

Thanks everyone. This is now merged.

wweic pushed a commit to wweic/tvm that referenced this pull request Jun 26, 2019
* [Relay][TOPI] operator All

* Update tests/python/frontend/tensorflow/test_forward.py

Co-Authored-By: yongwww <[email protected]>

* fix comments

* change to level 4
wweic pushed a commit to neo-ai/tvm that referenced this pull request Jun 27, 2019
* [Relay][TOPI] operator All

* Update tests/python/frontend/tensorflow/test_forward.py

Co-Authored-By: yongwww <[email protected]>

* fix comments

* change to level 4
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.

6 participants