Basically what happens in pseudoish code is:
time 1

for items in dataset 
    do some stuff

    update parameters

    accumulate costs

end of for 

time2

If I use .data[0] to accumulate costs, the total time is 11-12 and if I use .item() it is 16. Moreover putting sync just before time2 still gives total time 12 but putting sync anywhere in the for loop increases the total time to 16.