checkSingular static method

void checkSingular(
  1. Layout layout,
  2. int axis, [
  3. String? name
])

Asserts that the layout has a singular dimension on the axis.

Implementation

static void checkSingular(Layout layout, int axis, [String? name]) {
  if (layout.shape[axis] != 1) {
    throw LayoutError.singular(layout, axis, name);
  }
}