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

Function IsTensorStridesRowMajor

cpp/src/arrow/tensor.cc:116–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114namespace {
115
116inline bool IsTensorStridesRowMajor(const std::shared_ptr<DataType>& type,
117 const std::vector<int64_t>& shape,
118 const std::vector<int64_t>& strides) {
119 std::vector<int64_t> c_strides;
120 const auto& fw_type = checked_cast<const FixedWidthType&>(*type);
121 if (internal::ComputeRowMajorStrides(fw_type, shape, &c_strides).ok()) {
122 return strides == c_strides;
123 } else {
124 return false;
125 }
126}
127
128inline bool IsTensorStridesColumnMajor(const std::shared_ptr<DataType>& type,
129 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