MCPcopy Create free account
hub / github.com/dblalock/bolt / check_encoding

Function check_encoding

cpp/quantize/test_bolt.cpp:118–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118void check_encoding(int nrows, const RowMatrix<uint8_t>& encoding_out) {
119 for (int i = 0; i < nrows; i++) {
120 for(int m = 0; m < 2 * M; m++) {
121 // indices are packed into upper and lower 4 bits
122 int byte = encoding_out(i, m / 2);
123 int idx = m % 2 ? byte >> 4 : byte & 0x0F;
124 REQUIRE(idx == m + (i % 5)); // i % 5 from how we designed mat
125 }
126 }
127}
128
129TEST_CASE("bolt_encode", "[mcq][bolt]") {
130 auto centroids = create_bolt_centroids(1);

Callers 1

test_bolt.cppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected