Hi,
The cuda api is asynchronous for most operations. So a profiler that does not do proper synchronization won’t give you accurate informations.
In particular, a non-async copy to or from the GPU will force synchronization and so wait for all outstanding tasks.
So this is expected. You can try to add a torch.cuda.synchronize() just before this line and all the time will be spent in that function instead of the copy.