| 1519 | } |
| 1520 | |
| 1521 | Status 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 | |
| 1538 | Status GetSparseTensorMetadata(const Buffer& metadata, std::shared_ptr<DataType>* type, |
| 1539 | std::vector<int64_t>* shape, |