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

Function CheckSparseTensorBodyBufferCount

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

Source from the content-addressed store, hash-verified

2487}
2488
2489Status CheckSparseTensorBodyBufferCount(const IpcPayload& payload,
2490 SparseTensorFormat::type sparse_tensor_format_id,
2491 const size_t ndim) {
2492 size_t expected_body_buffer_count = 0;
2493 ARROW_ASSIGN_OR_RAISE(expected_body_buffer_count,
2494 GetSparseTensorBodyBufferCount(sparse_tensor_format_id, ndim));
2495 if (payload.body_buffers.size() != expected_body_buffer_count) {
2496 return Status::Invalid("Invalid body buffer count for a sparse tensor");
2497 }
2498
2499 return Status::OK();
2500}
2501
2502} // namespace
2503

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