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

Method set_input

smallthinker/src/llama-graph.cpp:15–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13#include <cstring>
14
15void llm_graph_input_embd::set_input(const llama_ubatch * ubatch) {
16 if (ubatch->token) {
17 const int64_t n_tokens = ubatch->n_tokens;
18
19 ggml_backend_tensor_set(tokens, ubatch->token, 0, n_tokens*ggml_element_size(tokens));
20 }
21
22 if (ubatch->embd) {
23 const int64_t n_embd = embd->ne[0];
24 const int64_t n_tokens = ubatch->n_tokens;
25
26 ggml_backend_tensor_set(embd, ubatch->embd, 0, n_tokens*n_embd*ggml_element_size(embd));
27 }
28}
29
30void llm_graph_input_pos::set_input(const llama_ubatch * ubatch) {
31 if (ubatch->pos && pos) {

Callers 1

set_inputsMethod · 0.45

Calls 15

logFunction · 0.85
absFunction · 0.85
set_input_pos_bucketMethod · 0.80
s_copyMethod · 0.80
s_maskMethod · 0.80
set_input_kq_maskMethod · 0.80
get_swaMethod · 0.80
findMethod · 0.80
ggml_backend_tensor_setFunction · 0.50
ggml_element_sizeFunction · 0.50

Tested by

no test coverage detected