| 87 | // TODO(kirillovs): replace with effective block-quantizer from model evaluation code |
| 88 | template <typename TQuantizedBin> |
| 89 | void QuantizeBlock(TConstArrayRef<float> srcFeatureData, |
| 90 | bool allowNans, |
| 91 | ENanMode nanMode, |
| 92 | ui32 featureIdx, // for error message |
| 93 | |
| 94 | // if nanMode != ENanMode::Forbidden borders must include -min_float or +max_float |
| 95 | TConstArrayRef<float> borders, |
| 96 | TArrayRef<TQuantizedBin> quantizedData) { |
| 97 | Y_ASSERT(srcFeatureData.size() == quantizedData.size()); |
| 98 | for (size_t i : xrange(srcFeatureData.size())) { |
| 99 | quantizedData[i] = Quantize<TQuantizedBin>(featureIdx, |
| 100 | allowNans, |
| 101 | nanMode, |
| 102 | borders, |
| 103 | srcFeatureData[i]); |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | template <typename TQuantizedBin> |
| 108 | void Quantize(const ITypedArraySubset<float>& srcFeatureData, |
no test coverage detected