xtensor
xtensor copied to clipboard
Add a bounds check and negative slice support to strided view fill_args
Checklist
- [x] The title and commit message(s) are descriptive.
- [x] Small commits made to fix your PR have been squashed to avoid history pollution.
- [ ] Tests have been added for new features or bug fixes.
- [ ] API of new functions and classes are documented.
Description
Currently, when slicing a strided view, it may slice outside of the bounds unnoticed. Ranges already support both negative indices (same as here) as well as bounds checks (clamped).
The behavior in this PR mimics NumPy behavior for negative and out of bounds index access.