pratyushadk opened a new issue, #50906:
URL: https://github.com/apache/arrow/issues/50906

   ### Describe the enhancement requested
   
   Currently, calling SparseCSRMatrix::Make or SparseCSCMatrix::Make on a 1D 
dense tensor returns a NotImplemented error with the message "TODO for ndim <= 
1". The converter in csx_converter.cc explicitly bails out for any tensor with 
ndim <= 1.
   
   For a 1D vector, the CSR representation is well-defined and simple. The 
indptr has exactly two entries [0, nnz], the indices array holds the positions 
of non-zero values, and the values array holds the corresponding values. This 
is essentially a single-row sparse matrix. The COO format already handles 1D 
tensors, so the surrounding infrastructure is already in place.
   
   The fix is to add a 1D path in SparseCSXMatrixConverter alongside the 
existing 2D path, along with unit tests covering basic conversion, all-zero 
vectors, and a round-trip back to dense. I have already worked through the 
implementation and plan to submit a PR for this shortly.
   
   ndim == 0 (scalar) should continue to return Invalid since scalars have no 
meaningful sparse representation.
   
   
   ### Component(s)
   
   C++


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to