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

Function test_top_k

smallthinker/tests/test-sampling.cpp:86–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86static void test_top_k(const std::vector<float> & probs, const std::vector<float> & probs_expected, int k) {
87 sampler_tester tester(probs, probs_expected);
88
89 DUMP(&tester.cur_p);
90 tester.apply(llama_sampler_init_top_k(k));
91 tester.apply(llama_sampler_init_dist (0));
92 DUMP(&tester.cur_p);
93
94 tester.check();
95}
96
97static void test_top_p(const std::vector<float> & probs, const std::vector<float> & probs_expected, float p) {
98 sampler_tester tester(probs, probs_expected);

Callers 1

mainFunction · 0.70

Calls 4

llama_sampler_init_top_kFunction · 0.85
llama_sampler_init_distFunction · 0.85
applyMethod · 0.45
checkMethod · 0.45

Tested by

no test coverage detected