@jdily please see the release notes, especially the section called “Important Breakages and Workarounds”.
Maybe you are affected by this.

  
      
      GitHub
  
  
    

pytorch/pytorch 336

pytorch - Tensors and Dynamic neural networks in Python  with strong GPU acceleration