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
infer old squeeze on known input shape and empty axes #5283
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: daquexian <daquexian566@gmail.com>
Signed-off-by: daquexian <daquexian566@gmail.com>
if (!ctx.getInputType(0)->tensor_type().has_shape()) { | ||
return; | ||
} | ||
|
||
ctx.getOutputType(0)->mutable_tensor_type()->mutable_shape(); | ||
const auto& input_shape = ctx.getInputType(0)->tensor_type().shape(); | ||
const auto input_ndim = input_shape.dim_size(); |
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.
That seems to be the same code than above, could it be moved in one separate function?
operatorsetid.domain = "" | ||
operatorsetid.version = 11 | ||
self._assert_inferred( | ||
graph, [make_tensor_value_info("y", TensorProto.FLOAT, (3, 2))] |
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 guess that the opset needs to be specified, eg., something like opset_imports=[helper.make_opsetid(ONNX_DOMAIN, 11)]
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
📢 Thoughts on this report? Let us know!. |
the shape inference of squeeze 13 can handle the case that the input shape is known and the axes is unspecified, but that of older version squeezes not. This PR fixes it.