Unrelated to this issue, but you are accumulating the loss tensor and would thus store the entire computation graph with it here:
epochLossSum = epochLossSum + loss

If epochLossSum is only used for printing purposes, call .detach() on loss before accumulating it.
I can’t see any obvious mistake in your code, so would recommend to try to overfit a small dataset (e.g. just 10 samples) and check if your model is able to do so by playing around with some hyperparameters.