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

Function ComputeShapeProduct

cpp/src/arrow/extension/tensor_internal.cc:33–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31namespace arrow::internal {
32
33Result<int64_t> ComputeShapeProduct(std::span<const int64_t> shape) {
34 int64_t product = 1;
35 for (const auto dim : shape) {
36 if (MultiplyWithOverflow(product, dim, &product)) {
37 return Status::Invalid(
38 "Product of tensor shape dimensions would not fit in 64-bit integer");
39 }
40 }
41 return product;
42}
43
44bool IsPermutationTrivial(std::span<const int64_t> permutation) {
45 for (size_t i = 1; i < permutation.size(); ++i) {

Callers 1

DeserializeMethod · 0.85

Calls 2

MultiplyWithOverflowFunction · 0.85
InvalidFunction · 0.50

Tested by

no test coverage detected