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

Function native_vector

python/tests/test_refine_flat_storage.py:256–262  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

254 return hits
255
256 def native_vector(values):
257 vector = np.asarray(values, dtype=np.float32)
258 if effective_flat_data_type == DataType.VECTOR_FP16:
259 return vector.astype(np.float16).astype(np.float32)
260 if effective_flat_data_type == DataType.VECTOR_UINT8:
261 return vector.astype(np.uint8).astype(np.float32)
262 return vector
263
264 def assert_native_fetch(collection, doc_index):
265 fetched = collection.fetch(ids=[str(doc_index)])[str(doc_index)]

Callers 2

assert_native_fetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected