args: ["--line-length", "119", "--target-version", "py35"]
types: ["python"]
- repo: https://github.com/pycqa/flake8
- rev: 3.8.3
+ rev: 7.2.0
hooks:
- id: flake8
args: ["--config", "bindings/python/setup.cfg"]
self.assertEqual(weights["test"].device, torch.device("cpu"))
torch.set_default_device(torch.device("cpu"))
+ torch.set_default_device(torch.device(0))
+ weights = load_file(self.sf_filename)
+ self.assertEqual(weights["test"].device, torch.device("cpu"))
+ torch.set_default_device(torch.device("cpu"))
+
@unittest.skipIf(not torch.cuda.is_available(), "Cuda is not available")
def test_deserialization_safe_gpu(self):
# First time to hit disk