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

Automatic strides for a final dim of extent 1 is 1 instead of product of previous extents in the default and dense_array case #101

Open
jiawen opened this issue May 31, 2024 · 0 comments
Assignees

Comments

@jiawen
Copy link
Collaborator

jiawen commented May 31, 2024

Code:

nda::array_of_rank<float, 4> image({640, 480, 3, 1});
LOG(INFO) << image.shape();

nda::array_of_rank<float, 4> image2({640, 480, 3, 10});
LOG(INFO) << image2.shape();

nda::array_of_rank<float, 4> image3({640, 480, 3, 20});
LOG(INFO) << image3.shape();

nda::array_ref_of_rank<float, 5> image3_embedded = nda::convert_shape<nda::shape_of_rank<5>>(image3.ref());
LOG(INFO) << image3_embedded.shape();

Output:

I0000 00:00:1717188518.011478 19279011 array_test.cpp:49] shape<4>(dim(0, 640, 1), dim(0, 480, 640), dim(0, 3, 307200), dim(0, 1, 1))
I0000 00:00:1717188518.047921 19279011 array_test.cpp:52] shape<4>(dim(0, 640, 1), dim(0, 480, 640), dim(0, 3, 307200), dim(0, 10, 921600))
I0000 00:00:1717188518.117122 19279011 array_test.cpp:55] shape<4>(dim(0, 640, 1), dim(0, 480, 640), dim(0, 3, 307200), dim(0, 20, 921600))
I0000 00:00:1717188518.117223 19279011 array_test.cpp:60] shape<5>(dim(0, 640, 1), dim(0, 480, 640), dim(0, 3, 307200), dim(0, 20, 921600), dim(0, 1, 1))

Investigate why this isn't covered by #95.

@jiawen jiawen self-assigned this May 31, 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

No branches or pull requests

1 participant