def setUp(self): # Note that test case fixtures are executed in both the main process and # worker processes. super().setUp() if combinations.in_main_process(): combinations.env().tf_data_service_dispatcher = "localhost"
def testNotShareGPU(self): self.assertLen(context.context().list_physical_devices("GPU"), combinations.env().total_phsyical_gpus / 2)
def testUpdateEnvInWorker(self): with self.assertRaises(ValueError): combinations.env().tf_data_service_dispatcher = "localhost"
def setUp(self): super().setUp() if combinations.in_main_process(): num_gpus = combinations.env().total_phsyical_gpus if num_gpus != 2 and num_gpus != 4: self.skipTest("requires 2 or 4 GPUs")
def testTfDataServiceDispatcher(self): self.assertEqual(combinations.env().tf_data_service_dispatcher, "localhost")