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

Function MakeSparseCOOTensorFromTensor

cpp/src/arrow/tensor/coo_converter.cc:278–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

276}
277
278Status MakeSparseCOOTensorFromTensor(const Tensor& tensor,
279 const std::shared_ptr<DataType>& index_value_type,
280 MemoryPool* pool,
281 std::shared_ptr<SparseIndex>* out_sparse_index,
282 std::shared_ptr<Buffer>* out_data) {
283 SparseCOOTensorConverter converter(tensor, index_value_type, pool);
284 RETURN_NOT_OK(converter.Convert());
285
286 *out_sparse_index = checked_pointer_cast<SparseIndex>(converter.sparse_index);
287 *out_data = converter.data;
288 return Status::OK();
289}
290
291Result<std::shared_ptr<Tensor>> MakeTensorFromSparseCOOTensor(
292 MemoryPool* pool, const SparseCOOTensor* sparse_tensor) {

Callers 1

Calls 2

OKFunction · 0.50
ConvertMethod · 0.45

Tested by

no test coverage detected