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

Function GetSparseCSFIndexMetadata

cpp/src/arrow/ipc/metadata_internal.cc:1521–1536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1519}
1520
1521Status GetSparseCSFIndexMetadata(const flatbuf::SparseTensorIndexCSF* sparse_index,
1522 std::vector<int64_t>* axis_order,
1523 std::vector<int64_t>* indices_size,
1524 std::shared_ptr<DataType>* indptr_type,
1525 std::shared_ptr<DataType>* indices_type) {
1526 RETURN_NOT_OK(IntFromFlatbuffer(sparse_index->indptrType(), indptr_type));
1527 RETURN_NOT_OK(IntFromFlatbuffer(sparse_index->indicesType(), indices_type));
1528
1529 const int ndim = static_cast<int>(sparse_index->axisOrder()->size());
1530 for (int i = 0; i < ndim; ++i) {
1531 axis_order->push_back(sparse_index->axisOrder()->Get(i));
1532 indices_size->push_back(sparse_index->indicesBuffers()->Get(i)->length());
1533 }
1534
1535 return Status::OK();
1536}
1537
1538Status GetSparseTensorMetadata(const Buffer& metadata, std::shared_ptr<DataType>* type,
1539 std::vector<int64_t>* shape,

Callers 2

ReadSparseCSFIndexFunction · 0.85
ReadSparseTensorPayloadFunction · 0.85

Calls 6

IntFromFlatbufferFunction · 0.85
push_backMethod · 0.80
OKFunction · 0.50
sizeMethod · 0.45
GetMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected