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

Method push_back

smallthinker/src/llama-sampling.cpp:53–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 }
52
53 void push_back(const T & value) {
54 if (capacity == 0) {
55 throw std::runtime_error("ring buffer: capacity is zero");
56 }
57
58 if (sz == capacity) {
59 // advance the start when buffer is full
60 first = (first + 1) % capacity;
61 } else {
62 sz++;
63 }
64 data[pos] = value;
65 pos = (pos + 1) % capacity;
66 }
67
68 T pop_front() {
69 if (sz == 0) {

Callers 15

to_vectorMethod · 0.45
llama_sampler_top_k_implFunction · 0.45
llama_sampler_chain_addFunction · 0.45
llama_sampler_dry_acceptFunction · 0.45
load_tensorsMethod · 0.45
print_infoMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected