Skip to content

Commit

Permalink
num_replicas -> num_replicas_in_sync (tensorflow#5752)
Browse files Browse the repository at this point in the history
`num_replicas` is being replaced by `num_replicas_in_sync` and something that returns the number of steps running concurrently.
  • Loading branch information
josh11b authored and Taylor Robie committed Nov 14, 2018
1 parent 628b970 commit 4d4eb85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions official/utils/misc/distribution_utils_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ class GetDistributionStrategyTest(tf.test.TestCase):
"""Tests for get_distribution_strategy."""
def test_one_device_strategy_cpu(self):
ds = distribution_utils.get_distribution_strategy(0)
self.assertEquals(ds.num_replicas, 1)
self.assertEquals(ds.num_replicas_in_sync, 1)
self.assertEquals(len(ds.worker_devices), 1)
self.assertIn('CPU', ds.worker_devices[0])

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

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

0 comments on commit 4d4eb85

Please sign in to comment.