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

Function ggml_reshape_1d

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

Source from the content-addressed store, hash-verified

3530}
3531
3532struct ggml_tensor * ggml_reshape_1d(
3533 struct ggml_context * ctx,
3534 struct ggml_tensor * a,
3535 int64_t ne0) {
3536 GGML_ASSERT(ggml_is_contiguous(a));
3537 GGML_ASSERT(ggml_nelements(a) == ne0);
3538
3539 const int64_t ne[1] = { ne0 };
3540 struct ggml_tensor * result = ggml_new_tensor_impl(ctx, a->type, 1, ne, a, 0);
3541 ggml_format_name(result, "%s (reshaped)", a->name);
3542
3543 result->op = GGML_OP_RESHAPE;
3544 result->src[0] = a;
3545
3546 return result;
3547}
3548
3549struct ggml_tensor * ggml_reshape_2d(
3550 struct ggml_context * ctx,

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