MCPcopy Create free account
hub / github.com/BorealisAI/scaleformer / _acquire_device

Method _acquire_device

exp/exp_basic.py:34–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

32 raise NotImplementedError
33
34 def _acquire_device(self):
35 if self.args.use_gpu:
36 device = torch.device('cuda:{}'.format(self.args.gpu))
37 print('Use GPU: cuda:{}'.format(self.args.gpu))
38 else:
39 device = torch.device('cpu')
40 print('Use CPU')
41 return device
42
43 def _get_data(self):
44 pass

Callers 1

__init__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected