pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

Implement indexing operations in PyTorch

Open HarshvirSandhu opened this issue 1 year ago • 1 comments

Implement indexing ops in pytorch

  • [x] Subtensor
  • [ ] IncSubtensor
  • [x] AdvancedSubtensor[1]
  • [ ] AdvancedIncSubtensor[1]

Description

Related Issue

  • [x] Related to #821

Checklist

Type of change

  • [x] New feature / enhancement

HarshvirSandhu avatar Jul 09 '24 18:07 HarshvirSandhu

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

Impacted file tree graph

@@           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%> (ø)

codecov[bot] avatar Jul 10 '24 07:07 codecov[bot]

@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

ricardoV94 avatar Sep 01 '24 10:09 ricardoV94