Unfortunately, I don’t know how threads are exactly used in libtorch.
However, this



 nitya05:

Because I can see the threads even after the task is complete.


sounds like a bug.
Could you post a minimal, executable code snippet to reproduce this issue?