Open ryan-williams opened 1 month ago
Introduce a new method ("np.array") for converting (COO) tiledbsoma.SparseNDArray data to (dense) torch.Tensor.
tiledbsoma.SparseNDArray
torch.Tensor
Comparison vs. existing ("scipy.csr") method:
Code/data here:
scipy.csr
Convert arrow.Table to scipy.sparse.csr_matrix (source). This is the current behavior.
arrow.Table
scipy.sparse.csr_matrix
np.array
Directly convert arrow.Table to np.array (source).
This method is new here, and seems to offer more speed at the cost of using more memory. It brings SOMA chunks into memory as dense np.arrays.
Introduce a new method ("np.array") for converting (COO)
tiledbsoma.SparseNDArray
data to (dense)torch.Tensor
.Comparison vs. existing ("scipy.csr") method:
Code/data here:
torch.Tensor
s.scipy.csr
Convert
arrow.Table
toscipy.sparse.csr_matrix
(source). This is the current behavior.np.array
Directly convert
arrow.Table
tonp.array
(source).This method is new here, and seems to offer more speed at the cost of using more memory. It brings SOMA chunks into memory as dense
np.array
s.