andishgar commented on code in PR #47586:
URL: https://github.com/apache/arrow/pull/47586#discussion_r2381152672
##########
cpp/src/arrow/tensor/csx_converter.cc:
##########
@@ -70,47 +74,34 @@ class SparseCSXMatrixConverter : private
SparseTensorConverterMixin {
ARROW_ASSIGN_OR_RAISE(auto values_buffer,
AllocateBuffer(value_elsize * nonzero_count, pool_));
- auto* values = values_buffer->mutable_data();
-
- const auto* tensor_data = tensor_.raw_data();
-
- if (ndim <= 1) {
- return Status::NotImplemented("TODO for ndim <= 1");
- } else {
- ARROW_ASSIGN_OR_RAISE(indptr_buffer,
- AllocateBuffer(index_elsize * (n_major + 1),
pool_));
- auto* indptr = indptr_buffer->mutable_data();
-
- ARROW_ASSIGN_OR_RAISE(indices_buffer,
- AllocateBuffer(index_elsize * nonzero_count,
pool_));
- auto* indices = indices_buffer->mutable_data();
-
- std::vector<int64_t> coords(2);
- int64_t k = 0;
- std::fill_n(indptr, index_elsize, 0);
Review Comment:
@rok regarding
[this](https://github.com/apache/arrow/pull/47586#discussion_r2378745142):
the above code is equivalent to `indptr[0] = 0`;, since indptr always starts
with 0. So we explicitly set the first element to zero, and then set the
remaining elements in a loop.
--
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]