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

Method ValidateShape

cpp/src/arrow/sparse_tensor.h:305–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303 }
304
305 inline Status ValidateShape(const std::vector<int64_t>& shape) const override {
306 ARROW_RETURN_NOT_OK(SparseIndex::ValidateShape(shape));
307
308 if (shape.size() < 2) {
309 return Status::Invalid("shape length is too short");
310 }
311
312 if (shape.size() > 2) {
313 return Status::Invalid("shape length is too long");
314 }
315
316 if (indptr_->shape()[0] == shape[static_cast<int64_t>(kCompressedAxis)] + 1) {
317 return Status::OK();
318 }
319
320 return Status::Invalid("shape length is inconsistent with the ", ToString());
321 }
322
323 protected:
324 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