Skip to content

how can i do equivalent of torch.cat in ggml tensor ? #421

Discussion options

You must be logged in to vote
        struct ggml_tensor * condL = ggml_new_tensor_2d(ctx0, cond->type, 1024, cond->ne[1] + textL->ne[1]);
        struct ggml_tensor * dst_lo = ggml_view_2d(ctx0, condL, 1024, cond->ne[1], cond->nb[1],0);
        struct ggml_tensor * dst_hi = ggml_view_2d(ctx0, condL, 1024, textL->ne[1], textL->nb[1], ggml_element_size(condL) * cond->ne[1]);
        ggml_cpy(ctx0, cond, dst_lo);
        ggml_cpy(ctx0, textL, dst_hi);

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@manmay-nakhashi
Comment options

@manmay-nakhashi
Comment options

Answer selected by manmay-nakhashi
@manmay-nakhashi
Comment options

@slaren
Comment options

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