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

Method set_input

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

Source from the content-addressed store, hash-verified

16#include <unordered_set>
17
18void llm_graph_input_embd::set_input(const llama_ubatch * ubatch) {
19 if (ubatch->token) {
20 const int64_t n_tokens = ubatch->n_tokens;
21
22 ggml_backend_tensor_set(tokens, ubatch->token, 0, n_tokens*ggml_element_size(tokens));
23 }
24
25 if (ubatch->embd) {
26 GGML_ASSERT(n_embd == embd->ne[0]);
27
28 const int64_t n_tokens = ubatch->n_tokens;
29
30 ggml_backend_tensor_set(embd, ubatch->embd, 0, n_tokens*n_embd*ggml_element_size(embd));
31 }
32}
33
34bool llm_graph_input_embd::can_reuse(const llm_graph_params & params) {
35 bool res = true;

Callers 1

set_inputsMethod · 0.45

Calls 15

ggml_backend_tensor_setFunction · 0.85
ggml_element_sizeFunction · 0.85
logFunction · 0.85
ggml_nbytesFunction · 0.85
ggml_nelementsFunction · 0.85
print_maskFunction · 0.85
equal_seqsMethod · 0.80
set_input_pos_bucketMethod · 0.80
get_n_rsMethod · 0.80
s_copyMethod · 0.80

Tested by

no test coverage detected