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

Function ggml_reshape_3d

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

Source from the content-addressed store, hash-verified

3565}
3566
3567struct ggml_tensor * ggml_reshape_3d(
3568 struct ggml_context * ctx,
3569 struct ggml_tensor * a,
3570 int64_t ne0,
3571 int64_t ne1,
3572 int64_t ne2) {
3573 GGML_ASSERT(ggml_is_contiguous(a));
3574 GGML_ASSERT(ggml_nelements(a) == ne0*ne1*ne2);
3575
3576 const int64_t ne[3] = { ne0, ne1, ne2 };
3577 struct ggml_tensor * result = ggml_new_tensor_impl(ctx, a->type, 3, ne, a, 0);
3578 ggml_format_name(result, "%s (reshaped)", a->name);
3579
3580 result->op = GGML_OP_RESHAPE;
3581 result->src[0] = a;
3582
3583 return result;
3584}
3585
3586struct ggml_tensor * ggml_reshape_4d(
3587 struct ggml_context * ctx,

Callers 15

build_vitMethod · 0.85
buildMethod · 0.85
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

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

build_graphMethod · 0.68
build_graphMethod · 0.68
build_graphMethod · 0.68