This is because your code has some implicit broadcasting happening (according to numpy rules), that is subtle.
0.2.0 introduced numpy-style broadcasting. In your case, batch_ys is of shape 3 and y_pred is of shape 3, 1. With numpy’s broadcasting rules, batch_ys and y_pred will first be expanded to 3, 3 and then these expanded Tensors will be subtracted from each other.
Another small bug (unrelated to your convergence) I saw in your code is that you are using mdl.forward(batch_xs), this is incorrect to do, instead do: mdl(batch_xs).