Hi,
I think the problem with your timings is that all the cuda api is asynchronous and so your measurements are not correct. If you want to do that, you need to use torch.cuda.synchronize() before and after timings.
For the initialization, you can simply replace loss = Variable(torch.cuda.FloatTensor([0])) by loss = 0.