To switch processor environments all u need to do is go to the top bar and select ‘runtime’, then select ‘change runtime type’ and u’ll see the one u are currently using (‘none’) and u can switch by selecting GPU or TPU on the drop down.
Remember that when u change runtime u need to upload your project folder again coz it’s like switching to a different computer
If u want to use the TPU tho u have to install ‘torch.xlsa’ package. U can just search for ‘how to use run pytorch on TPU’.
The code for specifying running device should be still be kept