コード例 #1
0
ファイル: hardware_config_test.py プロジェクト: sli259/gromax
 def testFailsWithBadInput(self):
     with self.assertRaises(ValueError):
         distributeGpuIdsToTasks([1, 2, 3], 5)
     with self.assertRaises(ValueError):
         distributeGpuIdsToTasks([1, 2, 3], 2)
     with self.assertRaises(TypeError):
         distributeGpuIdsToTasks(1, 5)
コード例 #2
0
ファイル: hardware_config_test.py プロジェクト: sli259/gromax
 def testHandlesNonZeroStartingIDs(self):
     self.assertEqual(distributeGpuIdsToTasks([5, 18], 1), [[5, 18]])
コード例 #3
0
ファイル: hardware_config_test.py プロジェクト: sli259/gromax
 def testMultiTaskMultiGpu(self):
     # more GPUs than tasks
     self.assertEqual(distributeGpuIdsToTasks([0, 1, 2, 3], 2), [[0, 1], [2, 3]])
     # more tasks than GPUs
     self.assertEqual(distributeGpuIdsToTasks([0, 1], 6), [[0], [0], [0], [1], [1], [1]])
コード例 #4
0
ファイル: hardware_config_test.py プロジェクト: sli259/gromax
 def testMultiTaskSingleGpu(self):
     self.assertEqual(distributeGpuIdsToTasks([0], 3), [[0], [0], [0]])
コード例 #5
0
ファイル: hardware_config_test.py プロジェクト: sli259/gromax
 def testSingleTaskMultipleGpu(self):
     self.assertEqual(distributeGpuIdsToTasks([0, 1, 2], 1), [[0, 1, 2]])
コード例 #6
0
ファイル: hardware_config_test.py プロジェクト: sli259/gromax
 def testSingleTaskSingleGpu(self):
     self.assertEqual(distributeGpuIdsToTasks([0], 1), [[0]])