Skip to content

Commit

Permalink
worker_devices moving to ds.extended (tensorflow#5775)
Browse files Browse the repository at this point in the history
  • Loading branch information
josh11b authored and Taylor Robie committed Nov 21, 2018
1 parent 9a4848a commit b2522f9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions official/utils/misc/distribution_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ class GetDistributionStrategyTest(tf.test.TestCase):
def test_one_device_strategy_cpu(self):
ds = distribution_utils.get_distribution_strategy(0)
self.assertEquals(ds.num_replicas_in_sync, 1)
self.assertEquals(len(ds.worker_devices), 1)
self.assertIn('CPU', ds.worker_devices[0])
self.assertEquals(len(ds.extended.worker_devices), 1)
self.assertIn('CPU', ds.extended.worker_devices[0])

def test_one_device_strategy_gpu(self):
ds = distribution_utils.get_distribution_strategy(1)
self.assertEquals(ds.num_replicas_in_sync, 1)
self.assertEquals(len(ds.worker_devices), 1)
self.assertIn('GPU', ds.worker_devices[0])
self.assertEquals(len(ds.extended.worker_devices), 1)
self.assertIn('GPU', ds.extended.worker_devices[0])

def test_mirrored_strategy(self):
ds = distribution_utils.get_distribution_strategy(5)
self.assertEquals(ds.num_replicas_in_sync, 5)
self.assertEquals(len(ds.worker_devices), 5)
for device in ds.worker_devices:
self.assertEquals(len(ds.extended.worker_devices), 5)
for device in ds.extended.worker_devices:
self.assertIn('GPU', device)


Expand Down

0 comments on commit b2522f9

Please sign in to comment.