Deadlock during backward

Thank you, @ptrblck. I tried removing the Variable part for x and y, but it still causes a deadlock on mine. So, my installation is on a REHL 6.9 (Santiago) cluster system though, and it’s a gpu version. Also, as I had mentioned earlier, the code works fine on my Windows PC which has a cpu version.