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

[FEA] Support resize/reshape for mdarray. #499

Open
trivialfis opened this issue Feb 9, 2022 · 8 comments
Open

[FEA] Support resize/reshape for mdarray. #499

trivialfis opened this issue Feb 9, 2022 · 8 comments
Assignees
Labels
feature request New feature or request inactive-30d

Comments

@trivialfis
Copy link
Member

As suggested by @rg20 and @cjnolet in #437, some helper functions for late initialization of mdarray and support for reshape will greatly improve the usability of this new abstraction.

@trivialfis trivialfis added the feature request New feature or request label Feb 9, 2022
@cjnolet
Copy link
Member

cjnolet commented Mar 1, 2022

Just leaving a note that this is going to be needed before building our new sparse sparse formats.

@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@github-actions
Copy link

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

@mhoemmen
Copy link
Contributor

mhoemmen commented Aug 2, 2022

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

@trivialfis
Copy link
Member Author

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.

@mhoemmen
Copy link
Contributor

mhoemmen commented Aug 3, 2022

@trivialfis Thanks for taking a look at this!

I think reshaping without the size being changed would be really useful.

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?

@trivialfis
Copy link
Member Author

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.

@github-actions
Copy link

github-actions bot commented Sep 2, 2022

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request inactive-30d
Projects
Status: No status
Development

No branches or pull requests

4 participants