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

Function MakeSparseCSFTensorFromTensor

cpp/src/arrow/tensor/csf_converter.cc:269–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

267} // namespace
268
269Status MakeSparseCSFTensorFromTensor(const Tensor& tensor,
270 const std::shared_ptr<DataType>& index_value_type,
271 MemoryPool* pool,
272 std::shared_ptr<SparseIndex>* out_sparse_index,
273 std::shared_ptr<Buffer>* out_data) {
274 SparseCSFTensorConverter converter(tensor, index_value_type, pool);
275 RETURN_NOT_OK(converter.Convert());
276
277 *out_sparse_index = checked_pointer_cast<SparseIndex>(converter.sparse_index);
278 *out_data = converter.data;
279 return Status::OK();
280}
281
282Result<std::shared_ptr<Tensor>> MakeTensorFromSparseCSFTensor(
283 MemoryPool* pool, const SparseCSFTensor* sparse_tensor) {

Callers 1

Calls 2

OKFunction · 0.50
ConvertMethod · 0.45

Tested by

no test coverage detected