def _check_shape(Mstr, M, shape, axis=None):
    if (axis is None):
        assert (M.shape == shape), f'{Mstr}.shape != {shape}'
    else:
        assert (M.shape[axis] == shape), f'{Mstr}.shape[{axis}] != {shape}'
def _check_shape(Mstr, M, shape, axis=None):
    if (axis is None):
        assert (M.shape == shape), f'{Mstr}.shape != {shape}'
    else:
        assert (M.shape[axis] == shape), f'{Mstr}.shape[{axis}] != {shape}'