Skip to content

cute Internal Tensor slicing #1683

Closed Answered by ccecka
osayamenja asked this question in Q&A
Aug 4, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

We have never had the need for arbitrary tensor slicing and, more generally, find code that does use slicing like the above error prone and less generalizable. CuTe is designed for "regular" tilings, permutations, and slices rather than irregular and unaligned patterns like your example.

If you really want to shoehorn this, you could write

Tensor t = make_tensor(counting_iterator<int>(0), make_layout(make_shape(2, 10), LayoutRight{}));
// Tiler to extract a regular subtensor
Tensor t_2x8 = composition(t, make_tile(Layout<_2,_1>{}, Layout<Shape<_4,_2>, Stride<_1,_5>>{}));
// The second portion of the 4x2 multimode
Tensor t_2x4 = t_2x8(_, make_coord(_,1));
print_tensor(t_2x4);

but that's pr…

Replies: 1 comment 2 replies

Comment options

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

@asglover
Comment options

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