Skip to content

How to transpose a tensor and have the transpose reflected in contiguous memory with CUDA backend #684

Answered by balisujohn
balisujohn asked this question in Q&A
Discussion options

You must be logged in to vote

This strategy seems to work actually:

            KQV = ggml_reshape_3d(ctx0, KQV, 18,64,64);
            KQV = ggml_permute(ctx0, KQV, 1,0,2,3);
            KQV = ggml_cont_3d(ctx0, KQV, 64,18,64);
            KQV = ggml_reshape_4d(ctx0, KQV, 64,18,16,4);

Replies: 1 comment 2 replies

Comment options

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

@ggerganov
Comment options

Answer selected by balisujohn
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