checkEqualShape static method
Asserts that the layouts a
and b
share the same shape.
Implementation
static void checkEqualShape(Layout a, Layout b, [String? name]) {
if (a.rank != b.rank) {
throw LayoutError.rank(a, b, name);
}
for (var i = 0; i < a.rank; i++) {
if (a.shape[i] != b.shape[i]) {
throw LayoutError.shape(a, i, b, i, name);
}
}
}