I already know all the information you are giving me. You are still not addressing the PyTorch workaround for the situation. The workaround is not working for me,(the code for which I have shared in the original post). In case you don’t know which PyTorch tutorial I was referring to,have a look at this 21.