The valueError should be replace by masking the results for `mask = n < 8`
can wait for another PR