Update torch.device() logic

pull/73/head
OodavidsinoO 2 years ago
parent c9821db892
commit a3355ca659
  1. 2
      Disco_Diffusion.ipynb
  2. 2
      disco.py

@ -596,7 +596,7 @@
" MAX_ADABINS_AREA = 500000\n", " MAX_ADABINS_AREA = 500000\n",
"\n", "\n",
"import torch\n", "import torch\n",
"DEVICE = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')\n", "DEVICE = torch.device('cuda:0' if (torch.cuda.is_available() and not useCPU) else 'cpu')\n",
"print('Using device:', DEVICE)\n", "print('Using device:', DEVICE)\n",
"device = DEVICE # At least one of the modules expects this name..\n", "device = DEVICE # At least one of the modules expects this name..\n",
"\n", "\n",

@ -569,7 +569,7 @@ if USE_ADABINS:
MAX_ADABINS_AREA = 500000 MAX_ADABINS_AREA = 500000
import torch import torch
DEVICE = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu') DEVICE = torch.device('cuda:0' if (torch.cuda.is_available() and not useCPU) else 'cpu')
print('Using device:', DEVICE) print('Using device:', DEVICE)
device = DEVICE # At least one of the modules expects this name.. device = DEVICE # At least one of the modules expects this name..

Loading…
Cancel
Save