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

Function IsTensorStridesRowMajor

cpp/src/arrow/tensor.cc:143–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141
142namespace {
143bool IsTensorStridesRowMajor(const std::shared_ptr<DataType>& type,
144 const std::vector<int64_t>& shape,
145 const std::vector<int64_t>& strides) {
146 std::vector<int64_t> c_strides;
147 const auto& fw_type = checked_cast<const FixedWidthType&>(*type);
148 if (internal::ComputeRowMajorStrides(fw_type, shape, &c_strides).ok()) {
149 return strides == c_strides;
150 } else {
151 return false;
152 }
153}
154
155bool IsTensorStridesColumnMajor(const std::shared_ptr<DataType>& type,
156 const std::vector<int64_t>& shape,

Callers 2

is_row_majorMethod · 0.85

Calls 2

ComputeRowMajorStridesFunction · 0.85
okMethod · 0.45

Tested by

no test coverage detected