Skip to content

Updated test cases for reshape#2127

Merged
wschin merged 12 commits intoonnx:masterfrom
JamesAllingham:revamp_reshape_tests
Sep 18, 2019
Merged

Updated test cases for reshape#2127
wschin merged 12 commits intoonnx:masterfrom
JamesAllingham:revamp_reshape_tests

Conversation

@JamesAllingham
Copy link
Copy Markdown
Contributor

  • Increased the number of test cases from 5 to 7.

    • The new tests cover the 0 dim case
  • Changed the existing cases so that, where possible, the 'batch' dim is unchanged.

    • Some frameworks do not allow for the first dim to change, so this makes these tests more generally applicable (developers of ONNX importers and exporters can try and replicate the results from these test cases).
  • Generated the new test data, updated the operators doc, and updated the test coverage doc.

* Increased the number of test cases from 5 to 7.

    * The new tests cover the 0 dim case

* Changed the existing cases so that, where possible, the 'batch' dim is unchanged.

    * Some frameworks do not allow for the first dim to change, so this makes these tests more generally applicable.

* Generated the new test data, updated the operators doc, and updated the test coverage doc.
@JamesAllingham JamesAllingham requested a review from a team as a code owner June 25, 2019 08:56
@JamesAllingham
Copy link
Copy Markdown
Contributor Author

Hmmm, I can't seem to figure out why travis-ci is failing. There doesn't seem to be a reason given. Just The command "./.travis/script.sh" exited with 1.. Does anyone have any idea what the problem might be?

@JamesAllingham
Copy link
Copy Markdown
Contributor Author

@linkerzhang any idea why the travis-ci build is failing here? Also, the circlecle build has started to fail but I don't think it is a problem on my side since it used to pass and I haven't made any changes since it last passed. The error message suggests a problem with the venv:

ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jul 24, 2019

CLA assistant check
All committers have signed the CLA.

@postrational postrational added the topic: operator Issues related to ONNX operators label Aug 22, 2019
@postrational
Copy link
Copy Markdown
Contributor

@JamesAllingham I think Travis CI is failing, because your PR ends up modifying these files:

	modified:   docs/Operators.md
	modified:   docs/TestCoverage.md

These files are generated from other sources.
If you want to change them, you need to change their sources, then re-generate them and add to your PR.

@JamesAllingham
Copy link
Copy Markdown
Contributor Author

@postrational Thanks, re-generating the files has fixed the issue.

@prasanthpul prasanthpul added this to the 1.6 milestone Sep 9, 2019
Comment thread docs/Operators.md Outdated
'reordered_dims': np.array([4, 2, 3], dtype=np.int64),
'reduced_dims': np.array([3, 8], dtype=np.int64),
'extended_dims': np.array([3, 2, 2, 2], dtype=np.int64),
'reordered_dims': np.array([2, 4, 3], dtype=np.int64),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems that we should still have a test to test if the first dimension can be changed correctly. It doesn't sound right if we change all tests not to touch the first dimension. Those are tests for ONNX operators, not specific framework. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Totally agree, I did try to make sure that there were still tests touching the first dim, but I didn't think to specifically test reordering of the first dim with another. I'll add one back in.

Comment thread docs/Operators.md Outdated
zero_index = np.where(shape == 0)
new_shape[zero_index] = np.array(original_shape)[zero_index]

reshaped = np.reshape(data, new_shape)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It means that we should have a reference implementation of ONNX Reshape. I am thinking something like

reshaped = onnx_reshape_impl(…)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'll do that 👍

Copy link
Copy Markdown
Collaborator

@wschin wschin left a comment

Choose a reason for hiding this comment

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

Some places don't look right. Please take a look at my comments. Thanks.

@wschin wschin self-requested a review September 18, 2019 16:31
@wschin wschin merged commit 13b026f into onnx:master Sep 18, 2019
jcwchen pushed a commit to jcwchen/onnx that referenced this pull request Sep 23, 2020
* Revamped test cases for reshape

* Increased the number of test cases from 5 to 7.

    * The new tests cover the 0 dim case

* Changed the existing cases so that, where possible, the 'batch' dim is unchanged.

    * Some frameworks do not allow for the first dim to change, so this makes these tests more generally applicable.

* Generated the new test data, updated the operators doc, and updated the test coverage doc.

* Re-generated Operators.md and TestCoverage.md

* Added a reshape op reference implementation and more tests for reshaping the first dim of a tensor
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.

5 participants