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

Function CheckSparseTensorBodyBufferCount

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

Source from the content-addressed store, hash-verified

2546}
2547
2548Status CheckSparseTensorBodyBufferCount(const IpcPayload& payload,
2549 SparseTensorFormat::type sparse_tensor_format_id,
2550 const size_t ndim) {
2551 size_t expected_body_buffer_count = 0;
2552 ARROW_ASSIGN_OR_RAISE(expected_body_buffer_count,
2553 GetSparseTensorBodyBufferCount(sparse_tensor_format_id, ndim));
2554 if (payload.body_buffers.size() != expected_body_buffer_count) {
2555 return Status::Invalid("Invalid body buffer count for a sparse tensor");
2556 }
2557
2558 return Status::OK();
2559}
2560
2561} // namespace
2562

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