MCPcopy
hub / github.com/redis/redis-py / test_add_elem_q8_quant

Function test_add_elem_q8_quant

tests/test_vsets.py:110–122  ·  view source on GitHub ↗
(d_client)

Source from the content-addressed store, hash-verified

108
109@skip_if_server_version_lt("7.9.0")
110def test_add_elem_q8_quant(d_client):
111 float_array = [1, 4.32, 10.0, -21, -2.9]
112 resp = d_client.vset().vadd(
113 "myset",
114 vector=float_array,
115 element="elem1",
116 quantization=QuantizationOptions.BIN,
117 )
118 assert resp == 1
119
120 emb = d_client.vset().vemb("myset", "elem1")
121 expected_array = [1, 1, 1, -1, -1]
122 assert _validate_quantization(expected_array, emb, tolerance=0.0)
123
124
125@skip_if_server_version_lt("7.9.0")

Callers

nothing calls this directly

Calls 4

vaddMethod · 0.80
vembMethod · 0.80
_validate_quantizationFunction · 0.70
vsetMethod · 0.45

Tested by

no test coverage detected