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

Function CheckSparseTensorBodyBufferCount

cpp/src/arrow/ipc/reader.cc:2565–2576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2563}
2564
2565Status CheckSparseTensorBodyBufferCount(const IpcPayload& payload,
2566 SparseTensorFormat::type sparse_tensor_format_id,
2567 const size_t ndim) {
2568 size_t expected_body_buffer_count = 0;
2569 ARROW_ASSIGN_OR_RAISE(expected_body_buffer_count,
2570 GetSparseTensorBodyBufferCount(sparse_tensor_format_id, ndim));
2571 if (payload.body_buffers.size() != expected_body_buffer_count) {
2572 return Status::Invalid("Invalid body buffer count for a sparse tensor");
2573 }
2574
2575 return Status::OK();
2576}
2577
2578} // namespace
2579

Callers 1

ReadSparseTensorPayloadFunction · 0.85

Calls 5

ARROW_ASSIGN_OR_RAISEFunction · 0.70
InvalidFunction · 0.50
OKFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected