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

Function MakeTensorFromSparseCSCMatrix

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

Source from the content-addressed store, hash-verified

229}
230
231Result<std::shared_ptr<Tensor>> MakeTensorFromSparseCSCMatrix(
232 MemoryPool* pool, const SparseCSCMatrix* sparse_tensor) {
233 const auto& sparse_index =
234 internal::checked_cast<const SparseCSCIndex&>(*sparse_tensor->sparse_index());
235 const auto& indptr = sparse_index.indptr();
236 const auto& indices = sparse_index.indices();
237 const auto non_zero_length = sparse_tensor->non_zero_length();
238 return MakeTensorFromSparseCSXMatrix(
239 SparseMatrixCompressedAxis::COLUMN, pool, indptr, indices, non_zero_length,
240 sparse_tensor->type(), sparse_tensor->shape(), sparse_tensor->size(),
241 sparse_tensor->raw_data(), sparse_tensor->dim_names());
242}
243
244} // namespace internal
245} // namespace arrow

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