I am trying to move a big tensor from CPU to GPU by the method .cuda()
But I found the time varies a lot. For example, the first time for moving data is about a few ms but the second moving may take a few seconds. When I use pdb to debug the code, the time of TENSOR.cuda() operation is fast if I pause a while before executing the operation. If I do not pause, the operation will take longer time.
When I use ctrl + c to stop the program, the code is on
return new_type(self.size()).copy_(self,async)
So does anyone know what caused this?