| 16 | #include <unordered_set> |
| 17 | |
| 18 | void 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 | |
| 34 | bool llm_graph_input_embd::can_reuse(const llm_graph_params & params) { |
| 35 | bool res = true; |
no test coverage detected