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

Method ValidateShape

cpp/src/arrow/sparse_tensor.h:299–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297 }
298
299 inline Status ValidateShape(const std::vector<int64_t>& shape) const override {
300 ARROW_RETURN_NOT_OK(SparseIndex::ValidateShape(shape));
301
302 if (shape.size() < 2) {
303 return Status::Invalid("shape length is too short");
304 }
305
306 if (shape.size() > 2) {
307 return Status::Invalid("shape length is too long");
308 }
309
310 if (indptr_->shape()[0] == shape[static_cast<int64_t>(kCompressedAxis)] + 1) {
311 return Status::OK();
312 }
313
314 return Status::Invalid("shape length is inconsistent with the ", ToString());
315 }
316
317 protected:
318 std::shared_ptr<Tensor> indptr_;

Callers 1

MakeMethod · 0.45

Calls 6

ValidateShapeFunction · 0.85
InvalidFunction · 0.70
OKFunction · 0.70
ToStringFunction · 0.70
sizeMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected