Large difference in the expected output of training

I am sorry to ask again but really I need to get answer to know if there is a wrong:
When I call the train method for a previously executed code I get different and large values of train_loss and val_score compared to the expected output
I only modified num_workers=0 instead of num_workers=2 and in loss_function I put reduction=‘sum’ /‘mean’ instead of size_average=false and train_loss += loss.item() instead of train_loss += loss.data[0]
this is what I got:
====> Epoch 1 | Train time: 22280.0055 ms| End time: 30543.6549 ms | Train loss: 124908514341585682432.0000 | Val loss: 157350129654111232.0000
====> Epoch 2 | Train time: 32893.7201 ms| End time: 41595.8421 ms | Train loss: 124899982131354140672.0000 | Val loss: 157340963977348576.0000
====> Epoch 3 | Train time: 5325.6693 ms| End time: 9422.5409 ms | Train loss: 124891590658610954240.0000 | Val loss: 157332308998118176.0000
====> Epoch 4 | Train time: 4294.8182 ms| End time: 11010.9062 ms | Train loss: 124882917710891057152.0000 | Val loss: 157323412109530400.0000
====> Epoch 5 | Train time: 3687.0134 ms| End time: 9978.2672 ms | Train loss: 124873804958520049664.0000 | Val loss: 157314125478089088.0000
====> Epoch 6 | Train time: 3680.8324 ms| End time: 10421.0193 ms | Train loss: 124863944538242154496.0000 | Val loss: 157304785089012768.0000
====> Epoch 7 | Train time: 3582.6883 ms| End time: 10224.6709 ms | Train loss: 124853644313313148928.0000 | Val loss: 157295431260527744.0000

and this is what I should get:
===> Epoch 1 | Train time: 1698.5452 ms| End time: 3036.2639 ms | Train loss: 29.3311 | Val loss: 18.4107
====> Epoch 2 | Train time: 1537.3888 ms| End time: 2866.3790 ms | Train loss: 23.3025 | Val loss: 18.3386
====> Epoch 3 | Train time: 1542.4740 ms| End time: 2884.9881 ms | Train loss: 23.2476 | Val loss: 16.7314
====> Epoch 4 | Train time: 1525.3885 ms| End time: 2869.0510 ms | Train loss: 22.8955 | Val loss: 17.5893
====> Epoch 5 | Train time: 1539.6032 ms| End time: 2873.3907 ms | Train loss: 21.6304 | Val loss: 16.0720
====> Epoch 6 | Train time: 1496.8140 ms| End time: 2832.1874 ms | Train loss: 21.3513 | Val loss: 16.0074
====> Epoch 7 | Train time: 1514.0126 ms| End time: 2854.8751 ms | Train loss: 20.4407 | Val loss: 15.8153
this is the code

Your post doesn’t contain enough information and an increase in the loss value might be expected based on these changes:

It’s however unclear to me what exactly this means, so please post a minimal, executable code snippet by wrapping it into three backticks, which would reproduce the issue.

sorry if the question is not clear enough.what does I mean is that:
I had to make the following changes to the pre-existing code due to using a newer version of the libraries:
num_workers=0 instead of num_workers=2

input_trainLoader = torch.utils.data.DataLoader(input_trainn, batch_size=args.batch_size, shuffle=False, num_workers=0)
pad_index_trainLoader = torch.utils.data.DataLoader(pad_index_trainn, batch_size=args.batch_size, shuffle=False, num_workers=0)

and put reduction=‘sum’ instead of size_average=‘false’

def loss_function(recon_x, x, pad_index):
MSE = F.mse_loss(recon_xpad_index, xpad_index, reduction=‘sum’)
return MSE

and put loss.item()instead of loss.data[0]

train_loss += loss.item()

And I got results that are not only different, but very huge. My question is, can these results be considered correct and are a natural result of the modifications I made, so I can continue in the executing and comparing later or did one of these modifications negatively affected the results, for example, I should have used reduction=‘none’ instead of size_average=‘false’? is my modifications wrong?

I am new here ,should I create new topic containing the edited question to get answer?or does not my edited question clear enough?