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

Support reshape #14

Open
MasonProtter opened this issue Nov 15, 2021 · 4 comments
Open

Support reshape #14

MasonProtter opened this issue Nov 15, 2021 · 4 comments

Comments

@MasonProtter
Copy link
Contributor

Currently, reshape(::StrideArray) gives a ReshapedArray. It'd be nice if we could do something similar to how view was handled.

@chriselrod
Copy link
Member

It should probably only return another StrideArray if the original array was dense and column major.

@MasonProtter
Copy link
Contributor Author

My usecase is that I want to make a large statically sized vector, then take a small dynamic view of that vector then reshape it to a matrix.

@chriselrod
Copy link
Member

You're welcome to make a PR!
But for that particular use case, you could also use ManualMemory.MemoryBuffer directly.

Another PR idea is to support that case directly, e.g. add support for providing a promise that the array is smaller than a given size, and then constructing a MemoryBuffer of the provided size.

@MasonProtter
Copy link
Contributor Author

Nice, sounds good

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