pytensor
pytensor copied to clipboard
Implement indexing operations in PyTorch
Implement indexing ops in pytorch
- [x] Subtensor
- [ ] IncSubtensor
- [x] AdvancedSubtensor[1]
- [ ] AdvancedIncSubtensor[1]
Description
Related Issue
- [x] Related to #821
Checklist
- [x] Checked that the pre-commit linting/style checks pass
- [x] Included tests that prove the fix is effective or that the new feature works
Type of change
- [x] New feature / enhancement
Codecov Report
Attention: Patch coverage is 85.41667% with 14 lines in your changes missing coverage. Please review.
Project coverage is 81.74%. Comparing base (
1a1c62b) to head (b38a01c). Report is 122 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| pytensor/link/pytorch/dispatch/subtensor.py | 84.61% | 9 Missing and 3 partials :warning: |
| pytensor/link/pytorch/dispatch/basic.py | 87.50% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #910 +/- ##
=======================================
Coverage 81.73% 81.74%
=======================================
Files 182 183 +1
Lines 47633 47724 +91
Branches 11604 11616 +12
=======================================
+ Hits 38934 39011 +77
- Misses 6509 6520 +11
- Partials 2190 2193 +3
| Files with missing lines | Coverage Δ | |
|---|---|---|
| pytensor/compile/mode.py | 84.54% <ø> (ø) |
|
| pytensor/link/pytorch/dispatch/__init__.py | 100.00% <100.00%> (ø) |
|
| pytensor/link/pytorch/dispatch/basic.py | 93.33% <87.50%> (-1.54%) |
:arrow_down: |
| pytensor/link/pytorch/dispatch/subtensor.py | 84.61% <84.61%> (ø) |
@HarshvirSandhu I pushed some simplification and also needed special logic for repeated indices in IncSubtensor. Feel free to review and see if you spot any issues. Note that I squashed the commits and force-pushed, so you'll have to retrieve the remote branch before you can do any changes