You have a small mistake in your model, i.e. nn.MSELoss expects the model output and the target to have the same shape. If that’s not the case the tensors will be broadcasted if possible.
In your case tr_y is has only one dimension ([100]), while pred has two ([100, 1]).
Change the loss to loss = loss_fct(pred, tr_y.unsqueeze(1)) and you’ll get approx. the same performance (and coefficient of determination R^2) for both models.
PS: I’ve formatted your post to easily copy your code. You can add code snippets using three backticks ```