MCPcopy Create free account
hub / github.com/alibaba/zvec / test_quantizer_parameter_representation

Function test_quantizer_parameter_representation

python/tests/test_params.py:74–82  ·  view source on GitHub ↗
(param_type, quantize_type, expected_name)

Source from the content-addressed store, hash-verified

72 ],
73)
74def test_quantizer_parameter_representation(param_type, quantize_type, expected_name):
75 # Parameters can be represented even when their index/quantizer combination
76 # is rejected at collection creation. Compare to the specified name, not
77 # only to the original: a round trip can preserve an incorrect string.
78 param = param_type(metric_type=MetricType.L2, quantize_type=quantize_type)
79 for value in (param, param.clone(), pickle.loads(pickle.dumps(param))):
80 assert value.quantize_type == quantize_type
81 assert value.to_dict()["quantize_type"] == expected_name
82 assert expected_name in repr(value)
83
84
85# ----------------------------

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected