keras/src/ops/linalg.py/_assert_2d
def _assert_2d(*arrays):
    for a in arrays:
        if a.ndim < 2:
            raise ValueError(
                "Expected input to have rank >= 2. "
                "Received input with shape {a.shape}."
            )