Skip to content

Conversation

adityagoel4512
Copy link
Contributor

@adityagoel4512 adityagoel4512 commented May 5, 2023

Description

Shape inference when transposing scalars.

Motivation and Context

Currently when transposing a scalar, the output shape is left unset leading to Shape Inference errors. This PR makes sure this doesn't happen by ensuring the output type has a 0 dimensional shape for scalar inputs.

@adityagoel4512 adityagoel4512 marked this pull request as ready for review May 5, 2023 22:17
@adityagoel4512 adityagoel4512 requested review from a team as code owners May 5, 2023 22:17
@adityagoel4512 adityagoel4512 force-pushed the transpose_scalar_shape_inference branch from 8f24c5a to a0106ea Compare May 5, 2023 22:22
andembry and others added 7 commits May 9, 2023 09:52
Signed-off-by: Bryan Anderson <andembry@amazon.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
* Add function inliner part 1

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Inliner for model-local functions

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Minor fixes

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Export inliner to python

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Fix emptied files

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* remove constexpr

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Replace move by copy

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Run formatter

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Format file

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Check names are unique

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* naming conventions

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Test for opset mistmatch

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Remove move

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Address PR feedback

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Add testcase with two calls to same function

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Comment debugging code

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Add comments about renaming

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

* Run formatter

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>

---------

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: jbachurski <kbachurski@gmail.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: ideal <40137309+slowlyideal@users.noreply.github.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
@adityagoel4512 adityagoel4512 force-pushed the transpose_scalar_shape_inference branch from 1d8dc45 to d5fe868 Compare May 9, 2023 08:53
dependabot bot and others added 6 commits May 10, 2023 21:45
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
…onnx#5210)

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
…023 (onnx#5208)

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: ideal <40137309+slowlyideal@users.noreply.github.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
…nnx#5169)

Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
@adityagoel4512 adityagoel4512 force-pushed the transpose_scalar_shape_inference branch from abbf137 to 13dc5b1 Compare May 10, 2023 20:45
@jcwchen jcwchen added the module: shape inference Issues related to shape inference label May 11, 2023
Copy link
Member

@jcwchen jcwchen left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@jcwchen jcwchen enabled auto-merge (squash) May 11, 2023 05:30
@jcwchen jcwchen disabled auto-merge May 11, 2023 15:12
@jcwchen jcwchen merged commit b390767 into onnx:main May 11, 2023
adityagoel4512 added a commit to adityagoel4512/onnx that referenced this pull request Jul 28, 2023
Signed-off-by: Bryan Anderson <andembry@amazon.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Signed-off-by: Ganesan Ramalingam <grama@microsoft.com>
Signed-off-by: jbachurski <kbachurski@gmail.com>
Signed-off-by: ideal <40137309+slowlyideal@users.noreply.github.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
Co-authored-by: Bryan Anderson <andembry@amazon.com>
Co-authored-by: G. Ramalingam <grama@microsoft.com>
Co-authored-by: Jakub Bachurski <kbachurski@gmail.com>
Co-authored-by: ideal <40137309+slowlyideal@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Chun-Wei Chen <jacky82226@gmail.com>
Signed-off-by: Aditya Goel <agoel4512@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: shape inference Issues related to shape inference
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants