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

Method reset

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

Source from the content-addressed store, hash-verified

656}
657
658void llm_graph_result::reset() {
659 t_inp_tokens = nullptr;
660 t_inp_embd = nullptr;
661 t_logits = nullptr;
662 t_embd = nullptr;
663 t_embd_pooled = nullptr;
664 t_sampled.clear();
665 t_sampled_probs.clear();
666 t_sampled_logits.clear();
667 t_candidates.clear();
668
669 params = {};
670
671 inputs.clear();
672
673 buf_compute_meta.resize(ggml_tensor_overhead()*max_nodes + ggml_graph_overhead_custom(max_nodes, false));
674
675 ggml_init_params params = {
676 /*.mem_size =*/ buf_compute_meta.size(),
677 /*.mem_buffer =*/ buf_compute_meta.data(),
678 /*.no_alloc =*/ true,
679 };
680
681 ctx_compute.reset(ggml_init(params));
682
683 gf = ggml_new_graph_custom(ctx_compute.get(), max_nodes, false);
684}
685
686void llm_graph_result::set_inputs(const llama_ubatch * ubatch) {
687 for (auto & input : inputs) {

Callers

nothing calls this directly

Calls 10

ggml_tensor_overheadFunction · 0.85
ggml_initFunction · 0.85
ggml_new_graph_customFunction · 0.85
clearMethod · 0.65
sizeMethod · 0.65
resetMethod · 0.65
getMethod · 0.65
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected