MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_repeat

Function ggml_repeat

ggml.c:3687–3706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3685// ggml_repeat
3686
3687struct ggml_tensor * ggml_repeat(
3688 struct ggml_context * ctx,
3689 struct ggml_tensor * a,
3690 struct ggml_tensor * b) {
3691 GGML_ASSERT(ggml_can_repeat(a, b));
3692
3693 bool is_node = false;
3694
3695 if (a->grad) {
3696 is_node = true;
3697 }
3698
3699 struct ggml_tensor * result = ggml_new_tensor(ctx, a->type, b->n_dims, b->ne);
3700
3701 result->op = GGML_OP_REPEAT;
3702 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
3703 result->src[0] = a;
3704
3705 return result;
3706}
3707
3708// ggml_repeat_back
3709

Callers 9

ggml_add1_or_setFunction · 0.70
ggml_compute_backwardFunction · 0.70
mainFunction · 0.50
forwardFunction · 0.50
forward_batchFunction · 0.50
forward_loraFunction · 0.50
clip_image_build_graphFunction · 0.50
llama_build_train_graphsFunction · 0.50

Calls 3

ggml_can_repeatFunction · 0.70
ggml_new_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70

Tested by 1

mainFunction · 0.40