MCPcopy Create free account
hub / github.com/Niko1221/Strata / draft_one

Method draft_one

engine/src/split/src/batch.cpp:105–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105int BatchDecoder::draft_one(BatchLane& L, int T, bool from_main, int src_row, const std::vector<int>& toks, int pos0,
106 const std::vector<int>& pen_seq, Dist& q) {
107 const bool pen = pen_drafts_ && penalizes(L.s), samp = samp_drafts_ && L.s.temperature > 0.f;
108 Engine::Penalties::Row row;
109 if (pen) row = penalty_row(pen_seq, L.s);
110 int d = e_.draft(T, from_main, src_row, toks, pos0, pen ? &row : nullptr, samp);
111 ++last_calls;
112 q = Dist{};
113 if (samp) {
114 std::uniform_real_distribution<double> unif(0.0, 1.0);
115 q = make_dist(e_.last_draft_cands, L.s);
116 d = draw(q, unif(L.rng));
117 }
118 return d;
119}
120
121std::vector<BatchDecoder::Emitted> BatchDecoder::window(const std::vector<BatchLane*>& lanes, const std::vector<int>& limit,
122 const std::function<void(int, int)>& emit) {

Callers

nothing calls this directly

Calls 5

penalizesFunction · 0.85
penalty_rowFunction · 0.85
make_distFunction · 0.70
drawFunction · 0.70
draftMethod · 0.45

Tested by

no test coverage detected