In this line of code you are scaling the current batch loss with the batch size and accumulate it:
running_loss =+ loss.item() * data.size(0)

while you are normalizing it with the batch size instead of the Dataset length here:
loss_values.append(running_loss/len(data))

My guess is that the last batch size might be smaller and would thus increase the loss in the last step.