MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / tearDown

Method tearDown

tests/networks/test_convert_to_trt.py:46–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

44 self.gpu_device = torch.cuda.current_device()
45
46 def tearDown(self):
47 current_device = torch.cuda.current_device()
48 if current_device != self.gpu_device:
49 torch.cuda.set_device(self.gpu_device)
50
51 @parameterized.expand([TEST_CASE_1, TEST_CASE_2])
52 @unittest.skipUnless(has_torchtrt and has_tensorrt, "Torch-TensorRT is required for convert!")

Callers

nothing calls this directly

Calls 1

set_deviceMethod · 0.45

Tested by

no test coverage detected