Skip to content

How to implement this chunk op using ggml_view #925

Answered by slaren
bssrdf asked this question in Q&A
Discussion options

You must be logged in to vote

For the lower chunk you only need to change the dimensions of the tensor. For the higher chunk, additionally you also have to skip the first 5 elements, which can be done with an offset. Eg.:

tlo = ggml_view_4d(5, 3, 3, 1, t->nb[1], t->nb[2], t->nb[3], 0);
thi = ggml_view_4d(5, 3, 3, 1, t->nb[1], t->nb[2], t->nb[3], t->nb[0]*5);

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@bssrdf
Comment options

Answer selected by bssrdf
Comment options

You must be logged in to vote
0 replies
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