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

Function ggml_reshape_2d

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

Source from the content-addressed store, hash-verified

3547}
3548
3549struct ggml_tensor * ggml_reshape_2d(
3550 struct ggml_context * ctx,
3551 struct ggml_tensor * a,
3552 int64_t ne0,
3553 int64_t ne1) {
3554 GGML_ASSERT(ggml_is_contiguous(a));
3555 GGML_ASSERT(ggml_nelements(a) == ne0*ne1);
3556
3557 const int64_t ne[2] = { ne0, ne1 };
3558 struct ggml_tensor * result = ggml_new_tensor_impl(ctx, a->type, 2, ne, a, 0);
3559 ggml_format_name(result, "%s (reshaped)", a->name);
3560
3561 result->op = GGML_OP_RESHAPE;
3562 result->src[0] = a;
3563
3564 return result;
3565}
3566
3567struct ggml_tensor * ggml_reshape_3d(
3568 struct ggml_context * ctx,

Callers 15

build_inpMethod · 0.85
build_attnMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 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 3

test_view_inplaceFunction · 0.68
build_graphMethod · 0.68
llm_build_kv_storeMethod · 0.68