| 103 | } |
| 104 | |
| 105 | int 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 | |
| 121 | std::vector<BatchDecoder::Emitted> BatchDecoder::window(const std::vector<BatchLane*>& lanes, const std::vector<int>& limit, |
| 122 | const std::function<void(int, int)>& emit) { |
nothing calls this directly
no test coverage detected