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

Function ggml_cast

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

Source from the content-addressed store, hash-verified

3433}
3434
3435struct ggml_tensor * ggml_cast(
3436 struct ggml_context * ctx,
3437 struct ggml_tensor * a,
3438 enum ggml_type type) {
3439 struct ggml_tensor * result = ggml_new_tensor(ctx, type, GGML_MAX_DIMS, a->ne);
3440 ggml_format_name(result, "%s (copy)", a->name);
3441
3442 result->op = GGML_OP_CPY;
3443 result->src[0] = a;
3444 result->src[1] = result; // note: this self-reference might seem redundant, but it's actually needed by some
3445 // backends for consistency with ggml_cpy_impl() above
3446
3447 return result;
3448}
3449
3450// ggml_cont
3451

Callers 15

merge_tensorMethod · 0.85
build_attnMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
build_moe_ffnMethod · 0.85
build_attn_mhaMethod · 0.85
build_attn_inp_kv_implFunction · 0.85
build_attn_inp_k_implFunction · 0.85
build_attn_inp_crossMethod · 0.85

Calls 2

ggml_new_tensorFunction · 0.85
ggml_format_nameFunction · 0.85

Tested by

no test coverage detected