I am a little confused by the operations ordering:
Shouldn’t it be:
start.record()
z = x + y

# Waits for everything to finish running
torch.cuda.synchronize()
end.record()

I have actually tried before and after and it gives different results, which I did not expect…
Can someone explains why there is a difference ?