Skip to content

c_STRIDED example for span #127

Answered by tylov
ib00 asked this question in Q&A
May 2, 2025 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Yes, in the span_demo.c example it is used it make a "downsampled view" of an image in each direction, using the cspan_shape() and cspan_strides() macros.

    Span2 img = cspan_md(md3.data, 6, 10);
    Span2 half = {img.data, cspan_shape(img.shape[0]/2, img.shape[1]/2),
                            cspan_strides(img.stride.d[0]*2, img.stride.d[1]*2)};

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ib00
Comment options

@tylov
Comment options

tylov May 6, 2025
Maintainer

Answer selected by ib00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants