-
Notifications
You must be signed in to change notification settings - Fork 529
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
refactor(ONNX): replaces getValueList
helper with createScalarSublist
#3987
base: main
Are you sure you want to change the base?
refactor(ONNX): replaces getValueList
helper with createScalarSublist
#3987
Conversation
Hey, @AmosLewis, could you review this since @zjgarvey is out? Zach reviewed a lot of it under #3945, but wanted to split into two stacked PRs to make each final diff smaller. |
I'll get a chance to review today, too. But it would be good to get Chi's review too. |
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.
Thanks, Jacob. The helper function getValueList
would certainly benefit from some cleanup.
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.
Adding a few more comments, mostly pertaining to the other function I didn't review earlier.
2e2300b
to
9e57557
Compare
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.
Nice! This looks good. Just a few changes and we should merge this. Ping me when you're done and I'll approve.
Thanks!
9e57557
to
1580393
Compare
@zjgarvey All the tweaks were super quick, and one of them sparked a few ideas! It took some time, but I think it'll be worth it:
I think there's a ton of opportunity for subsequent PRs to leverage these new helpers to gradually distill the implementation for these conversions! Hoping that it leaves you nitless, but we'll see! Just let me know haha. |
getValueList
helper with createScalarSublist
getValueList
helper with createTorchScalarSublist
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.
Hey, Jacob.
The PR was in a great state to merge before you made the undiscussed changes. To make this process more efficient, would you please revert those changes so that we can merge the PR as discussed earlier?
This PR is blocking your progress on another PR, so I don't want to spend another day or two going back and forth on these new changes.
f61b1e8
to
a751f8c
Compare
…tValueList` helper
- avoids useless declaration and assignment
… `getValueList` helper
…ValueList` helper
…n `getValueList` helper
…alueList` helper
…` helper - `operand`: helper isn't concerned with how the call site things about this - `input`: tells us that it's a parameter passed into this scope, but the implementation eventually tells us that we're treating it like a tensor - `inputTensor`: but not just _any_ tensor, it's a 1D tensor - `input1DTensor`: "input" has been used elsewhere to mean "first operand for an operation", and this function isn't a full-blown op, so we gotta use something else - `given1DTensor`: bingo
…lueList` helper - `operandType`: "operand" is the given tensor - `castedGiven1DTensorType`: can be renamed as validated generic - `some1DTensorType`: meaning "type of some 1D tensor"
- Before: - "get": implies retrieval of some private property - "Value": restatement of the return type `Value` - "List": assumed result of casting the returned instance - After: - "create": contextualizes the need to pass in `rewriter` - "Scalar": contextualizes the opaque return type - "Sublist": the relationship between the first parameter and the returned result
a751f8c
to
db12b36
Compare
getValueList
helper with createTorchScalarSublist
getValueList
helper with createScalarSublist
A preliminary refactor to support #3945