Esempio n. 1
0
 def test_linear_model_multi_gpu(self):
     backend_config = backend.BackendConfig({
         'use_cuda': True,
         'cuda_device': 1
     })
     with cuda.Device(0):
         accuracy = self.model.accuracy(backend_config)
     self.assertGreater(cuda.to_cpu(accuracy.data), 0.9)
 def test_linear_model_multi_gpu(self):
     backend_config = backend.BackendConfig({
         'use_cuda': True,
         'cuda_device': 1
     })
     skip, msg = self.skip_loss_scaling(backend_config)
     if skip:
         return unittest.SkipTest(msg)
     with cuda.Device(0):
         accuracy = self.model.accuracy(backend_config)
     self.assertGreater(cuda.to_cpu(accuracy.data), 0.9)
 def accuracy_gpu(self, device):
     with cuda.get_device_from_id(device):
         return self.accuracy(
             backend.BackendConfig({'use_cuda': True}),
             device)