-
Notifications
You must be signed in to change notification settings - Fork 72
[IR] Display constant tensors for Value #2248
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
Display constant values and simplify the value repr string when fields are empty
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.
Pull Request Overview
This PR updates the repr method for the Value class so that it displays constant tensor values and simplifies the representation when optional fields are empty. Key changes include:
- Conditionally appending type, shape, producer, index, and const_value fields to the repr string.
- Removing the default "None" string for missing producer information.
- Improving the overall consistency of field formatting in the repr output.
❌ 3 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
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.
Pull Request Overview
This PR improves the string representations of constant Value objects by including tensor details when available and simplifying the output when fields are empty. Key changes include:
- Adding conditional inclusion of type, shape, and producer information in repr.
- Introducing a shortened representation for const_value in repr and a similar change in str when the tensor size is small.
Does this show up in the displayed form of a Node? Eg., if we have a node |
In a node, it won't show. In a graph it will show in the initializers section
A
Is that ok? Or maybe we want to see it directly in the node? |
I updated for it to show
|
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.
What do we have when it's larger than 10 elements?
It will show |
Great! (My original request, at least, was for the ability to see it in the node.) What would be even better (IMO) is if this can be made "less busy" ... in typical usage, just the values will suffice (you want to see "0" or "1" or "0.36712") ... given that the full information is available elsewhere, if a user really wants to know, a shorter version should work better here. I do think there is a difference between seeing |
Sounds goo - I will create a follow up |
Display constant values and simplify the value repr string when fields are empty.
Fix #2073