Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cropping via ranges results in an array with the same indices as the old array #24

Open
dsharlet opened this issue Jul 7, 2020 · 1 comment

Comments

@dsharlet
Copy link
Owner

dsharlet commented Jul 7, 2020

In numpy and many other systems, b = a(interval(5, 12)) results in an array where b(x) == a(x + 5) and b has an extent of 7 (and a min of 0).

In array, this doesn't happen. b(x) == a(x), where b has a min of x.min() + 5 and an extent of 7. The only other system that is similar that I'm aware of is Halide.

This is very convenient for tiling algorithms transparently, but may not be what people would prefer to see in other use cases.

I lean towards the current behavior (which enables transparent tiling of algorithms), but it would be good to find a way to seamlessly enable the numpy style as well.

@jiawen
Copy link
Collaborator

jiawen commented Dec 21, 2022

I wonder if you can make operator()(interval i) a template template <enum CropBehavior> operator()(interval i).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants