-
Notifications
You must be signed in to change notification settings - Fork 455
Add target for converting to channels last format #1581
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
Conversation
143db68
to
b097bf2
Compare
This pull request introduces 1 alert when merging ffa34bb into d4be5af - view on LGTM.com new alerts:
|
ffa34bb
to
e7e9343
Compare
Signed-off-by: Tom Wildenhain <[email protected]>
e3db072
to
8ba83c9
Compare
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Signed-off-by: Tom Wildenhain [email protected]