Skip to content

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

Description

@jiawen

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions