| 338 | namespace { |
| 339 | |
| 340 | inline Status CheckSparseCSFIndexValidity(const std::shared_ptr<DataType>& indptr_type, |
| 341 | const std::shared_ptr<DataType>& indices_type, |
| 342 | const int64_t num_indptrs, |
| 343 | const int64_t num_indices, |
| 344 | const int64_t axis_order_size) { |
| 345 | if (!is_integer(indptr_type->id())) { |
| 346 | return Status::TypeError("Type of SparseCSFIndex indptr must be integer"); |
| 347 | } |
| 348 | if (!is_integer(indices_type->id())) { |
| 349 | return Status::TypeError("Type of SparseCSFIndex indices must be integer"); |
| 350 | } |
| 351 | if (num_indptrs + 1 != num_indices) { |
| 352 | return Status::Invalid( |
| 353 | "Length of indices must be equal to length of indptrs + 1 for SparseCSFIndex."); |
| 354 | } |
| 355 | if (axis_order_size != num_indices) { |
| 356 | return Status::Invalid( |
| 357 | "Length of indices must be equal to number of dimensions for SparseCSFIndex."); |
| 358 | } |
| 359 | return Status::OK(); |
| 360 | } |
| 361 | |
| 362 | } // namespace |
| 363 |
no test coverage detected