Skip to content

Allow DenseVector construction from NumPy arrays and tensors #69

Description

@peopleig

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions