MCPcopy Create free account
hub / github.com/MegEngine/MegCC / equal_layout

Function equal_layout

runtime/test/common/common.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7namespace {
8
9static int equal_layout(const Layout& layout0, const Layout& layout1) {
10 if (layout0.nr_dim != layout1.nr_dim) {
11 return false;
12 }
13 for (int32_t i = 0; i < layout0.nr_dim; i++) {
14 if (layout0.dims[i] != layout1.dims[i] ||
15 layout0.stride[i] != layout1.stride[i]) {
16 return false;
17 }
18 }
19 return true;
20}
21
22static std::string layout_to_string(const Layout& layout) {
23 std::stringstream ss;

Callers 1

assert_tensor_eqFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected