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

Enhance Transpose optimizer "Mul" handler #978

Merged
merged 2 commits into from
Jun 19, 2020

Conversation

jignparm
Copy link
Contributor

Fixes #977

Previously Tranpose_Mul handler could only handle constant multipliers of shape (1). Added support fo shape(N).


# if multiplier is 1-D
if len(multiplier.shape) == 1:
if multiplier.shape[0] == 1:
Copy link
Collaborator

@RandySheriffH RandySheriffH Jun 19, 2020

Choose a reason for hiding this comment

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

Is it possible for "if..." at line 491 be merged to 486 like:
"if not multiplier.shape or multipier.shape == [1]"
Plus shall we have any UT for the enhancement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated unit test to see if 1D const tensors can be jumped over.

For the 'if' merging, it seems cleaner to separate handling of scalars and 1D tensors into 2 blocks (mostly for readability)

@jignparm jignparm merged commit f407c31 into onnx:master Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inputs_as_NCHW adds Transposes
3 participants