-
Notifications
You must be signed in to change notification settings - Fork 195
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
[FEA] Support resize/reshape
for mdarray
.
#499
Comments
Just leaving a note that this is going to be needed before building our new sparse sparse formats. |
This issue has been labeled |
This issue has been labeled |
Regarding mdarray (the C++ Standard Library proposal P1684), I posted some discussion here on why mdarray does not include this feature: ORNL/cpp-proposals-pub#287 |
Thank you for the discussion. I think reshaping without the size being changed would be really useful. As for changing the size, I haven't seen any actual use case other than changing the size from 0 to something else (initializing a variable). @cjnolet @divyegala might be able to provide more context. |
@trivialfis Thanks for taking a look at this!
Does this mean taking an mdspan, and a new layout mapping or extents, and returning an mdspan viewing a subset of the input mdspan's elements with the new layout mapping? |
That sounds right except for the subset part, which should be handled by submdspan instead of reshape. I think changing the mapping should be sufficient. From my perspective, it would be as simple as taking a vector of size 4 and returning a matrix of shape 2x2. No need for changing size. |
This issue has been labeled |
As suggested by @rg20 and @cjnolet in #437, some helper functions for late initialization of
mdarray
and support forreshape
will greatly improve the usability of this new abstraction.The text was updated successfully, but these errors were encountered: