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

Method build_attn_inp_cross

subprojects/llama.cpp/src/llama-graph.cpp:2043–2054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2041}
2042
2043llm_graph_input_attn_cross * llm_graph_context::build_attn_inp_cross() const {
2044 auto inp = std::make_unique<llm_graph_input_attn_cross>(cross);
2045
2046 const int32_t n_enc = !cross->v_embd.empty() ? cross->n_enc : hparams.n_ctx_train;
2047
2048 inp->cross_kq_mask = ggml_new_tensor_4d(ctx0, GGML_TYPE_F32, n_enc, n_tokens, 1, 1);
2049 ggml_set_input(inp->cross_kq_mask);
2050
2051 inp->cross_kq_mask_cnv = cparams.flash_attn ? ggml_cast(ctx0, inp->cross_kq_mask, GGML_TYPE_F16) : inp->cross_kq_mask;
2052
2053 return (llm_graph_input_attn_cross *) res->add_input(std::move(inp));
2054}
2055
2056ggml_tensor * llm_graph_context::build_attn(
2057 llm_graph_input_attn_cross * inp,

Callers

nothing calls this directly

Calls 5

ggml_new_tensor_4dFunction · 0.85
ggml_set_inputFunction · 0.85
ggml_castFunction · 0.85
add_inputMethod · 0.80
emptyMethod · 0.65

Tested by

no test coverage detected