Solved by ptrblck in post #2 
              
              
                Could you post a minimal executable code snippet using your classes to reproduce this issue? 
Also, which PyTorch version are you using at the moment? If you are not using the latest stable version (1.7.0), could you update to it?