-
Notifications
You must be signed in to change notification settings - Fork 8
Convenience function get_const_tensor #45
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
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
==========================================
- Coverage 74.51% 74.49% -0.03%
==========================================
Files 37 37
Lines 4595 4634 +39
Branches 933 946 +13
==========================================
+ Hits 3424 3452 +28
- Misses 826 832 +6
- Partials 345 350 +5 ☔ View full report in Codecov by Sentry. |
@codecov-ai-reviewer test |
On it! Codecov is generating unit tests for this PR. |
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
898a6c6
to
4fec7af
Compare
This PR adds tests for #45 ### Commits: - Add unit tests for get_constant_tensor function This commit adds a new test file to validate the newly added get_constant_tensor function. The tests cover various scenarios including direct constant values, values without producer nodes, values with non-Constant producer nodes, and values produced by Constant nodes with different attribute types (float, int, tensor). --------- Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Co-authored-by: codecov-ai[bot] <156709835+codecov-ai[bot]@users.noreply.github.com>
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.
lintrunner found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
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.
Unblocking nits and questions
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Get the constant tensor from a value, if it exists.
A constant tensor can be obtained if the value has a
const_value
set(as in the case of an initializer) or if the value is produced by a
Constant node.
This function will not alter the
const_value
of the value, butit will propagate the shape and type of the constant tensor to the value
if
propagate_shape_type
is set to True.