-
Notifications
You must be signed in to change notification settings - Fork 8
Create the convenience methods i()
and o()
on Node
#34
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
==========================================
+ Coverage 73.57% 73.59% +0.02%
==========================================
Files 37 37
Lines 4492 4496 +4
Branches 902 902
==========================================
+ Hits 3305 3309 +4
- Misses 858 859 +1
+ Partials 329 328 -1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
65016d4
to
86e7054
Compare
Signed-off-by: Justin Chu <[email protected]>
src/onnx_ir/_core.py
Outdated
def i(self, index: int = 0) -> Value | None: | ||
"""Get the input value at the given index. | ||
|
||
This is a convenience method that is equivalent to `self.inputs[index]`. |
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.
Can you add the new syntax self.inputs[index]
can be replaced by?
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.
Added docstring. Does that look good to you?
Signed-off-by: Justin Chu <[email protected]>
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.
Indexing on node.ouputs is more intuitive to me..
|
||
The following is equivalent:: | ||
|
||
node.outputs[0] == node.o(0) == node.o() # Default index is 0 |
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 feel it's duplicated.
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.
Ok. I will release 0.1.1 without this for now
i()
ando()
convenience methods toNode
for accessing input and output values by index, respectively.