Hi ptrblck,
Thanks a lot for the prompt reply.
Actually I have tried to detach the tensors and it doesn’t make an impact.
Could you please check the first three block, especially the third one in line 82 which says the increment of memory is over 27153241.914 MiB. It is quite weird.