Hi
You can execute this code on Google TPUs but you need to make certain changes to your code. You can find an example here 12. Also you can find more examples/tutorials on executing PyTorch codes on Google TPUs on the following GitHub repository https://github.com/pytorch/xla 8