-
Notifications
You must be signed in to change notification settings - Fork 632
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
[Capture] higher order primitives store slices instead of integers #6521
Conversation
Hello. You may have forgotten to update the changelog!
|
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 internal upgrade, I really like the changes! 🎉
Just had a few small comments, and wondered about the branches other than true_fn
not being flattened for cond
.
Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6521 +/- ##
=======================================
Coverage 99.34% 99.34%
=======================================
Files 455 456 +1
Lines 43193 43265 +72
=======================================
+ Hits 42909 42981 +72
Misses 284 284 ☔ View full report in Codecov by Sentry. |
…6521) **Context:** As the higher order primitives `for`, `while`, and `cond` get more feature-rich, especially with the incoming changes for dynamically shaped arrays, it can be hard to keep track of what order the arguments come in. This will get harder when we have to add in more positional arguments for the dynamically shaped array dimensions. **Description of the Change:** Updates `for`, `while` and `cond` to store slices into the positionally arguments instead of numbers of the different types of arguments. Now we can simply consume: ``` args[provided_slice] ``` instead of having to do: ``` args[some_calcualtion_for_start: some_calculation_for_end] ``` I also rewrote some of the logic in the for conditional to make it easier to construct all the relevant data. **Benefits:** **Possible Drawbacks:** For the for loop, the slices into the arguments start after the `start, stop, step` instead of including the offset by three. I wasn't quite sure which one made more sense. **Related GitHub Issues:** [sc-77579] --------- Co-authored-by: David Wierichs <david.wierichs@xanadu.ai>
Context:
As the higher order primitives
for
,while
, andcond
get more feature-rich, especially with the incoming changes for dynamically shaped arrays, it can be hard to keep track of what order the arguments come in. This will get harder when we have to add in more positional arguments for the dynamically shaped array dimensions.Description of the Change:
Updates
for
,while
andcond
to store slices into the positionally arguments instead of numbers of the different types of arguments. Now we can simply consume:instead of having to do:
I also rewrote some of the logic in the for conditional to make it easier to construct all the relevant data.
Benefits:
Possible Drawbacks:
For the for loop, the slices into the arguments start after the
start, stop, step
instead of including the offset by three. I wasn't quite sure which one made more sense.Related GitHub Issues:
[sc-77579]