MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / ggml_reshape_4d

Function ggml_reshape_4d

subprojects/llama.cpp/ggml/src/ggml.c:3586–3604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3584}
3585
3586struct ggml_tensor * ggml_reshape_4d(
3587 struct ggml_context * ctx,
3588 struct ggml_tensor * a,
3589 int64_t ne0,
3590 int64_t ne1,
3591 int64_t ne2,
3592 int64_t ne3) {
3593 GGML_ASSERT(ggml_is_contiguous(a));
3594 GGML_ASSERT(ggml_nelements(a) == ne0*ne1*ne2*ne3);
3595
3596 const int64_t ne[4] = { ne0, ne1, ne2, ne3 };
3597 struct ggml_tensor * result = ggml_new_tensor_impl(ctx, a->type, 4, ne, a, 0);
3598 ggml_format_name(result, "%s (reshaped)", a->name);
3599
3600 result->op = GGML_OP_RESHAPE;
3601 result->src[0] = a;
3602
3603 return result;
3604}
3605
3606static struct ggml_tensor * ggml_view_impl(
3607 struct ggml_context * ctx,

Callers 15

buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
build_mobilenet_attnMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
build_moe_ffnMethod · 0.85
build_attn_mhaMethod · 0.85
build_rwkv6_time_mixMethod · 0.85

Calls 4

ggml_is_contiguousFunction · 0.85
ggml_nelementsFunction · 0.85
ggml_new_tensor_implFunction · 0.85
ggml_format_nameFunction · 0.85

Tested by

no test coverage detected