init
Browse files
APDrawingGAN2/options/base_options.py
CHANGED
|
@@ -178,7 +178,7 @@ class BaseOptions():
|
|
| 178 |
if id >= 0:
|
| 179 |
opt.gpu_ids.append(id)
|
| 180 |
if len(opt.gpu_ids) > 0:
|
| 181 |
-
|
| 182 |
|
| 183 |
# set gpu ids
|
| 184 |
str_ids = opt.gpu_ids_p.split(',')
|
|
@@ -186,7 +186,7 @@ class BaseOptions():
|
|
| 186 |
for str_id in str_ids:
|
| 187 |
id = int(str_id)
|
| 188 |
if id >= 0:
|
| 189 |
-
|
| 190 |
|
| 191 |
self.opt = opt
|
| 192 |
return self.opt
|
|
|
|
| 178 |
if id >= 0:
|
| 179 |
opt.gpu_ids.append(id)
|
| 180 |
if len(opt.gpu_ids) > 0:
|
| 181 |
+
torch.cuda.set_device(opt.gpu_ids[0])
|
| 182 |
|
| 183 |
# set gpu ids
|
| 184 |
str_ids = opt.gpu_ids_p.split(',')
|
|
|
|
| 186 |
for str_id in str_ids:
|
| 187 |
id = int(str_id)
|
| 188 |
if id >= 0:
|
| 189 |
+
opt.gpu_ids_p.append(id)
|
| 190 |
|
| 191 |
self.opt = opt
|
| 192 |
return self.opt
|