Since you are appending the model output (y_train_pred) inside the training loop directly, the computation graph would also be stored, so you might want to detach() it before appending it to the list.
Also, the cpu() operation is synchronizing your code which might result in a slowdown.
There is unfortunately no workaround, since the values have to be already calculated if you want to push them to the CPU and convert them to a numpy array.