I tried to remove the special case of `X.size == 0`, but then `test_empty` fails (after tweaking to take the warning into account) as the returned value is nan thus not empty: `dot([], [])` is `False` and is then divided by `0.0`. Returning an empty array the size of the input array seems a better option.