When creating Variable (i.e. x1_var and target_y in your code), you do not need requires_grad=True since you most likely want to train the parameters of the model but you will not modify the input.
Also, this must be a type, but you call loss_function(predict_y, target_y) where it should be loss_function(predicted_y, target_y).
These are the two things I see for now