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

Function ggml_add_id

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

Source from the content-addressed store, hash-verified

2016}
2017
2018struct ggml_tensor * ggml_add_id(
2019 struct ggml_context * ctx,
2020 struct ggml_tensor * a,
2021 struct ggml_tensor * b,
2022 struct ggml_tensor * ids) {
2023
2024 GGML_ASSERT(a->ne[0] == b->ne[0]);
2025 GGML_ASSERT(a->ne[1] == ids->ne[0]);
2026 GGML_ASSERT(a->ne[2] == ids->ne[1]);
2027 GGML_ASSERT(ids->type == GGML_TYPE_I32);
2028
2029 struct ggml_tensor * result = ggml_dup_tensor(ctx, a);
2030
2031 result->op = GGML_OP_ADD_ID;
2032 result->src[0] = a;
2033 result->src[1] = b;
2034 result->src[2] = ids;
2035
2036 return result;
2037}
2038
2039// ggml_add1
2040

Callers 5

weight_buft_supportedFunction · 0.85
build_moe_ffnMethod · 0.85
build_graphMethod · 0.85
build_graphMethod · 0.85
ggml_vk_check_results_0Function · 0.85

Calls 1

ggml_dup_tensorFunction · 0.85

Tested by 2

build_graphMethod · 0.68
build_graphMethod · 0.68