Update todo to mention PartialSort

PiperOrigin-RevId: 618685783
This commit is contained in:
Jan Wassenberg 2024-03-24 17:13:55 -07:00 committed by Copybara-Service
parent fcf5c1af88
commit 3f2fabcfcb
1 changed files with 1 additions and 1 deletions

2
ops.h
View File

@ -711,7 +711,7 @@ static HWY_NOINLINE HWY_MAYBE_UNUSED int SampleTopK(
const float* HWY_RESTRICT probabilities, size_t vocab_size,
std::mt19937& gen, float temperature, TAcceptToken& accept_token) {
static_assert(k != 0, "");
// TODO(austinvhuang): Optimize this implementation.
// TODO: Optimize, potentially using new VQSort PartialSort.
std::array<float, k> top_k{}; // sorted from highest [0], to lowest [k-1]
std::array<int, k> indices{};
for (size_t i = 0; i < vocab_size; ++i) {