how can i do equivalent of torch.cat in ggml tensor ? #421
Answered
by
manmay-nakhashi
manmay-nakhashi
asked this question in
Q&A
Replies: 1 comment 4 replies
-
I don't think there is an op to do this directly, but you could get the same effect by creating two views with different offsets and copying each part separately: // concat a,b into dst
dst = ggml_new_tensor_1d(ctx, a->type, a->ne[0] + b->ne[0]);
dst_lo = ggml_view_1d(ctx, dst, a->ne[0], 0);
dst_hi = ggml_view_1d(ctx, dst, b->ne[0], ggml_element_size(dst) * a->ne[0]);
ggml_cpy(ctx, a, dst_lo);
ggml_cpy(ctx, b, dst_hi); |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i want to cocatenate two tensor with dim,1024 how can i do that ?
Beta Was this translation helpful? Give feedback.
All reactions