-
Notifications
You must be signed in to change notification settings - Fork 9
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 Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #34 +/- ##
=======================================
Coverage 74.86% 74.86%
=======================================
Files 39 39
Lines 4726 4730 +4
Branches 967 967
=======================================
+ Hits 3538 3541 +3
- Misses 839 840 +1
Partials 349 349 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
65016d4
to
86e7054
Compare
Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
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?
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.