Implementing `repeat` function
What type of PR is this? (check all applicable)
- [ ] 💾 Refactor
- [x] 🪄 Feature
- [ ] 🐞 Bug Fix
- [ ] 🔧 Optimization
- [ ] 📚 Documentation
- [ ] 🧪 Test
- [ ] 🛠️ Other
Related issues
- Related issue #
- Closes #
Checklist
- [ ] Code follows style guide
- [ ] Tests added
- [ ] Documented the changes
Part of the effort to adhere to array API standards. Similar to np.repeat but for sparse arrays.
@hameerabbasi Will add tests after your reviews
CodSpeed Performance Report
Merging #875 will degrade performances by 29.65%
Comparing prady0t:array-api-tests-adherence (ea38652) with main (9988853)
Summary
⚡ 2 improvements
❌ 1 regressions
✅ 337 untouched benchmarks
:warning: Please fix the performance issues or acknowledge them on CodSpeed.
Benchmarks breakdown
| Benchmark | BASE |
HEAD |
Change | |
|---|---|---|---|---|
| ⚡ | test_gcxs_dot_ndarray[coo-m=200-n=200-p=200] |
2.8 ms | 2 ms | +42.81% |
| ❌ | test_index_fancy[side=100-rank=1-format='coo'] |
939.4 µs | 1,335.2 µs | -29.65% |
| ⚡ | test_index_slice[side=100-rank=2-format='gcxs'] |
2.4 ms | 2 ms | +21.97% |
Yes, there were a few bugs, mostly with reshaping. I've removed them and added the tests. Hopefully, this is a correct implementation. The function still doesn't account for uneven repeats.
I think this is ready to be merged
Thanks, @prady0t!