MCPcopy Create free account
hub / github.com/apache/arrow / MakeTensorFromSparseCSRMatrix

Function MakeTensorFromSparseCSRMatrix

cpp/src/arrow/tensor/csx_converter.cc:218–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216} // namespace
217
218Result<std::shared_ptr<Tensor>> MakeTensorFromSparseCSRMatrix(
219 MemoryPool* pool, const SparseCSRMatrix* sparse_tensor) {
220 const auto& sparse_index =
221 internal::checked_cast<const SparseCSRIndex&>(*sparse_tensor->sparse_index());
222 const auto& indptr = sparse_index.indptr();
223 const auto& indices = sparse_index.indices();
224 const auto non_zero_length = sparse_tensor->non_zero_length();
225 return MakeTensorFromSparseCSXMatrix(
226 SparseMatrixCompressedAxis::ROW, pool, indptr, indices, non_zero_length,
227 sparse_tensor->type(), sparse_tensor->shape(), sparse_tensor->size(),
228 sparse_tensor->raw_data(), sparse_tensor->dim_names());
229}
230
231Result<std::shared_ptr<Tensor>> MakeTensorFromSparseCSCMatrix(
232 MemoryPool* pool, const SparseCSCMatrix* sparse_tensor) {

Callers 1

ToTensorMethod · 0.85

Calls 8

sparse_indexMethod · 0.80
indicesMethod · 0.80
raw_dataMethod · 0.80
non_zero_lengthMethod · 0.45
typeMethod · 0.45
shapeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected