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

Function ggml_repeat_4d

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

Source from the content-addressed store, hash-verified

2479}
2480
2481struct ggml_tensor * ggml_repeat_4d(
2482 struct ggml_context * ctx,
2483 struct ggml_tensor * a,
2484 int64_t ne0, int64_t ne1, int64_t ne2, int64_t ne3) {
2485 const bool can_repeat = ggml_is_empty(a) || (
2486 (ne0 % a->ne[0] == 0) &&
2487 (ne1 % a->ne[1] == 0) &&
2488 (ne2 % a->ne[2] == 0) &&
2489 (ne3 % a->ne[3] == 0)
2490 );
2491 GGML_ASSERT(can_repeat);
2492
2493 struct ggml_tensor * result = ggml_new_tensor_4d(ctx, a->type, ne0, ne1, ne2, ne3);
2494
2495 result->op = GGML_OP_REPEAT;
2496 result->src[0] = a;
2497
2498 return result;
2499}
2500
2501// ggml_repeat_back
2502

Callers 7

buildMethod · 0.85
build_moe_ffnMethod · 0.85
altup_correctMethod · 0.85

Calls 2

ggml_is_emptyFunction · 0.85
ggml_new_tensor_4dFunction · 0.85

Tested by

no test coverage detected