111137:

device = device_(“cuda” if cuda.is_available() else “cpu”)


What is device_ here?
You cannot change the model __init__ and add a device argument? As done here:



 spanev:

def init(self, device):


?
Also about the Colab you are running on, the default Tensor device might have been set with:
torch.set_default_tensor_type(torch.cuda.FloatTensor)

but I wouldn’t recommend relying on this.