Skip to content

Conversation

TomWildenhain-Microsoft
Copy link
Collaborator

Signed-off-by: Tom Wildenhain [email protected]

@lgtm-com
Copy link

lgtm-com bot commented Jun 28, 2021

This pull request introduces 1 alert when merging ffa34bb into d4be5af - view on LGTM.com

new alerts:

  • 1 for Unused import

if op.domain in [constants.ONNX_DOMAIN, constants.AI_ONNX_ML_DOMAIN]:
continue
# We still don't 100% trust the accuracy of all the shapes in graph.py, but for custom ops they are
# almost certainly accurate and onnx has no other way of knowing them.
Copy link
Collaborator

@xadupre xadupre Jun 29, 2021

Choose a reason for hiding this comment

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

Maybe one example would help here. Typical case: Reshape operator, Z = Reshape(X, Y) where X and Y are both inputs. There is no way to infer the shape of Z. Type should be always be known, if the shape is not known, the number of dimensions usually is. Sometimes, if a shape is not known, it can be guessed based on the forward nodes (Z = Gemm(Reshape(X, Y), W) where W has a known shape.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This case wasn't actually what I was referring to. Having unknown dims added is fine, the bigger issue would be actually incorrect dims. While manipulating the graph object I have in the past seen shape data become inaccurate (after it has been used). We now have tests for this and ideally it should never happen but I'm not 100% sure all bugs have been fixed.

args = get_args()

g, org_model_proto = load_graph(args.input)
g, org_model_proto = load_graph(args.input, args.target)
Copy link
Collaborator

@xadupre xadupre Jun 29, 2021

Choose a reason for hiding this comment

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

Maybe it would be worth adding an example in the documentation. Is it available through all APIs?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we could but right now onnx does not support this so it would be a little iffy.

@TomWildenhain-Microsoft TomWildenhain-Microsoft merged commit 98546b1 into master Jun 29, 2021
@TomWildenhain-Microsoft TomWildenhain-Microsoft deleted the tom/channel_last branch June 29, 2021 17:54
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.

3 participants