| 1051 | uint32_t seen_stamp_ = 1; |
| 1052 | }; |
| 1053 | |
| 1054 | template <typename Allowed> |
| 1055 | int32_t masked_argmax_index(const std::vector<float> & values, Allowed && allowed) { |
| 1056 | int32_t best = -1; |
| 1057 | float best_value = -std::numeric_limits<float>::infinity(); |
| 1058 | for (size_t i = 0; i < values.size(); ++i) { |
| 1059 | const int32_t token = static_cast<int32_t>(i); |
| 1060 | if (!allowed(token)) { |
| 1061 | continue; |
| 1062 | } |
| 1063 | if (best < 0 || values[i] > best_value) { |
no test coverage detected