Skip to content

Conversation

avinashsai
Copy link

Fixes #3985

@avinashsai avinashsai requested a review from a team as a code owner May 10, 2022 23:24
@@ -287,7 +287,7 @@ class ShapeInferenceImplBase {
has_experimental_op = true;
} else if (n.op_type() == "Constant" && n.output().size() == 1) {
for (const auto& attr : n.attribute()) {
if (attr.name() == "value") {
if (attr.name() == "value" || attr.name() == "value_ints") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for creating the PR. Unfortunately, I don't think this will be enough to fix the issue. When the name is "value_ints", the attribute type is a list of ints, and not a tensor. So, the lines below also need to be extended to handle it correctly.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the suggestions! If i am correct, I need to add similar else if block which handles list of ints right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. The proto fields are as defined here:

repeated int64 ints = 8; // list of ints

In addition, there is a need to convert the value into a TensorProto.

Copy link
Contributor

Choose a reason for hiding this comment

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

@gramalingam
Copy link
Contributor

This has been completed by a different PR.

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.

Handle Constant op variants in shape inference
2 participants