| 276 | } |
| 277 | |
| 278 | Status 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 | |
| 291 | Result<std::shared_ptr<Tensor>> MakeTensorFromSparseCOOTensor( |
| 292 | MemoryPool* pool, const SparseCOOTensor* sparse_tensor) { |
no test coverage detected