Skip to content

Conversation

@fbleibel-g
Copy link
Collaborator

No description provided.

Helps avoid the common mistake of creating an array from an existing
argument's shape, inheriting the strides and possibly violating
compile-time constraints. (e.g. creating a planar image from an
interleaved image's shape).
@fbleibel-g fbleibel-g marked this pull request as ready for review August 5, 2024 16:59
@dsharlet
Copy link
Owner

dsharlet commented Aug 5, 2024

How does this relate to #83? This looks similar to a suggestion I made there:

What if we just have a helper that drops all strides from shape? And maybe also try to make shapes easier to work with if you don't care about strides (if that's even an issue now)? array/array_ref could have a helper function bounds() that just returns the shape with all strides removed.

#83 (review)

I haven't been that happy with anything along these lines, but after so many years we should just go with what you have here.

@fbleibel-g
Copy link
Collaborator Author

This looks just like what you suggested. We also discussed this on Chat a while back and I think bounds() was the winner for this particular problem. If you don't have any objections then, I'll merge this in.

@dsharlet dsharlet merged commit e1525b0 into dsharlet:master Aug 6, 2024
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

Successfully merging this pull request may close these issues.

2 participants