Skip to content

More unsqueeze tests#2200

Merged
ebarsoum merged 11 commits intoonnx:masterfrom
JamesAllingham:more_unsqueeze_tests
Sep 15, 2019
Merged

More unsqueeze tests#2200
ebarsoum merged 11 commits intoonnx:masterfrom
JamesAllingham:more_unsqueeze_tests

Conversation

@JamesAllingham
Copy link
Copy Markdown
Contributor

There are now 3 test cases for Unsqueeze:

  • Unsqueeze 1 axis, which is really 3 tests for unsqueezing each axis of a 3d array
  • Unsqueeze 2 axes, which tests unsqueezing both the 1st and 4th axes of a 3d array
  • Unsqueeze 3 axes, which tests unsqueezing the 2nd, 4th and 5th axes of a 3d array

One weird thing is that the Operators.md and TestCoverage.md that were generated show the two and three axes test out of order, I'm not sure why that happened or if this is something to care about... it is just a little strange to read in that order.

@JamesAllingham JamesAllingham requested a review from a team as a code owner July 26, 2019 08:27
Comment thread docs/Operators.md Outdated
Comment thread docs/Operators.md
)
y = np.expand_dims(x, axis=2)
y = np.expand_dims(y, axis=4)
y = np.expand_dims(y, axis=5)
Copy link
Copy Markdown
Collaborator

@wschin wschin Aug 5, 2019

Choose a reason for hiding this comment

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

I am not sure if this is the valid test. The original tensor is 3-D, so the min axis you can expand is 0 and the max one is 3. Did I miss something? I found what I missed. The axes are output's axis indexes.

@wschin
Copy link
Copy Markdown
Collaborator

wschin commented Aug 5, 2019

Overall this PR looks good to me. I have one comment for changing an axis bound in your test.

Feedback from wschin to fix axis bounds.

Co-Authored-By: Wei-Sheng Chin <wschin@outlook.com>
Comment thread docs/Operators.md
@postrational postrational added the topic: operator Issues related to ONNX operators label Aug 22, 2019
@prasanthpul prasanthpul added this to the 1.6 milestone Sep 9, 2019
@ebarsoum ebarsoum merged commit f913b6e into onnx:master Sep 15, 2019
jcwchen pushed a commit to jcwchen/onnx that referenced this pull request Sep 23, 2020
* Added more test cases for Unsqueeze

* Added a test case for unsqueezing 3 dims

Also renamed the 1 dim test cases slightly.

* Added more test cases for Unsqueeze

* Added a test case for unsqueezing 3 dims

Also renamed the 1 dim test cases slightly.

* Update docs/Operators.md

Feedback from wschin to fix axis bounds.

Co-Authored-By: Wei-Sheng Chin <wschin@outlook.com>

* Re-ran update_doc.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: operator Issues related to ONNX operators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants