couldn't a higher n-dim with shape 1 lead to weird broadcasting?
Maybe check np.shape(y)[0] ?