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

Method VisitSparseIndex

cpp/src/arrow/ipc/writer.cc:1000–1029  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

998 ~SparseTensorSerializer() = default;
999
1000 Status VisitSparseIndex(const SparseIndex& sparse_index) {
1001 switch (sparse_index.format_id()) {
1002 case SparseTensorFormat::COO:
1003 RETURN_NOT_OK(
1004 VisitSparseCOOIndex(checked_cast<const SparseCOOIndex&>(sparse_index)));
1005 break;
1006
1007 case SparseTensorFormat::CSR:
1008 RETURN_NOT_OK(
1009 VisitSparseCSRIndex(checked_cast<const SparseCSRIndex&>(sparse_index)));
1010 break;
1011
1012 case SparseTensorFormat::CSC:
1013 RETURN_NOT_OK(
1014 VisitSparseCSCIndex(checked_cast<const SparseCSCIndex&>(sparse_index)));
1015 break;
1016
1017 case SparseTensorFormat::CSF:
1018 RETURN_NOT_OK(
1019 VisitSparseCSFIndex(checked_cast<const SparseCSFIndex&>(sparse_index)));
1020 break;
1021
1022 default:
1023 std::stringstream ss;
1024 ss << "Unable to convert type: " << sparse_index.ToString() << std::endl;
1025 return Status::NotImplemented(ss.str());
1026 }
1027
1028 return Status::OK();
1029 }
1030
1031 Status SerializeMetadata(const SparseTensor& sparse_tensor) {
1032 return WriteSparseTensorMessage(sparse_tensor, out_->body_length, buffer_meta_,

Callers

nothing calls this directly

Calls 4

strMethod · 0.80
NotImplementedFunction · 0.50
OKFunction · 0.50
ToStringMethod · 0.45

Tested by

no test coverage detected