Repository navigation
Fix object backend broadcasting and empty reductions - #263
Robertboy18 wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
|
The tests and lint checks pass. The docs failure is the mkdocstrings/pymdown-extensions compatibility issue; I opened #265 with the dependency constraint and a checked reproduction. Once that is merged, I can update this branch and rerun the docs check. |
(cherry picked from commit 5ac644e)
|
Thanks for fixing this! Could you take a look at what I just pushed? I moved the broadcasting into a preparation step using |
|
Thanks @dgasmith, I kept your |
Description
The object backend loses singleton broadcasting:
contract("i,i->i", [2], [3, 4, 5], backend="object")with object arrays returns[6], and reversing the operands raises an indexing error. Empty reductions also raiseTypeErrorinstead of returning zero.This preserves non-singleton dimensions (including zero), indexes broadcast axes at zero, and handles empty sums without requiring arbitrary objects to support addition with an integer.
I included the docs compatibility fix from #265 as a separate commit so CI can run on this branch.
Todos
Status
Implementation and tests were AI-assisted.