MCPcopy Create free account
hub / github.com/Anoise/WTFlib / _acquire_device

Method _acquire_device

LDPS_Graph/exp/exp_basic.py:17–26  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

15 return None
16
17 def _acquire_device(self):
18 if self.args.use_gpu:
19 os.environ["CUDA_VISIBLE_DEVICES"] = str(
20 self.args.gpu) if not self.args.use_multi_gpu else self.args.devices
21 device = torch.device('cuda:{}'.format(self.args.gpu))
22 print('Use GPU: cuda:{}'.format(self.args.gpu))
23 else:
24 device = torch.device('cpu')
25 print('Use CPU')
26 return device
27
28 def _get_data(self):
29 pass

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected