-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Capture] higher order primitives store slices instead of integers (#…
…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 <[email protected]>
- Loading branch information
Showing
4 changed files
with
81 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters