Users commonly work with vectors as NumPy arrays or tensors (e.g. from PyTorch, TensorFlow)
Currently, the Python client only accepts lists or tuples for DenseVector
Allow DenseVector to accept other common data types like numpy.ndarray, torch.Tensor, etc. (Other suggestions welcome)
Example: DenseVector(np_array)
Important
Validate shape - ensure 1D vectors
Ensure values are floats
Users commonly work with vectors as NumPy arrays or tensors (e.g. from PyTorch, TensorFlow)
Currently, the Python client only accepts lists or tuples for
DenseVectorAllow DenseVector to accept other common data types like
numpy.ndarray,torch.Tensor, etc. (Other suggestions welcome)Example:
DenseVector(np_array)Important
Validate shape - ensure 1D vectors
Ensure values are floats