/external/tensorflow/tensorflow/python/distribute/ |
D | input_ops.py | 30 def auto_shard_dataset(dataset, num_shards, index, num_replicas_in_sync=None): argument 50 if num_replicas_in_sync is None: 51 num_replicas_in_sync = 1 54 num_replicas_in_sync) 57 num_replicas_in_sync)
|
D | input_lib_test.py | 69 num_replicas_in_sync, argument 89 num_replicas_in_sync=len(devices))) 101 num_replicas_in_sync=num_replicas_in_sync, 109 num_replicas_in_sync, argument 118 num_replicas_in_sync=num_replicas_in_sync, 125 num_replicas_in_sync=num_replicas_in_sync, 171 num_replicas_in_sync=None, argument 191 num_replicas_in_sync, 200 num_replicas_in_sync, 658 num_replicas_in_sync=distribution.num_replicas_in_sync, [all …]
|
D | strategy_gather_test.py | 84 value_on_replica for _ in range(strategy.num_replicas_in_sync) 143 1, shape=(sum(range(strategy.num_replicas_in_sync + 1)), 1)) 165 1, shape=(1, sum(range(strategy.num_replicas_in_sync + 1)))) 175 if strategy.num_replicas_in_sync <= 1: 226 if strategy.num_replicas_in_sync <= 1: 293 all_value = [value_on_replica for _ in range(strategy.num_replicas_in_sync)] 378 1, shape=(sum(range(strategy.num_replicas_in_sync + 1)), 1)) 406 1, shape=(1, sum(range(strategy.num_replicas_in_sync + 1)))) 435 1, shape=(1, sum(range(strategy.num_replicas_in_sync + 1)))) 442 [value_2 for _ in range(strategy.num_replicas_in_sync)], axis=axis) [all …]
|
D | strategy_common_test.py | 92 self.assertEqual(fn_eager().numpy(), 1.0 * strategy.num_replicas_in_sync) 93 self.assertEqual(fn_graph().numpy(), 1.0 * strategy.num_replicas_in_sync) 97 self.assertEqual(fn_eager().numpy(), 1.0 * strategy.num_replicas_in_sync) 98 self.assertEqual(fn_graph().numpy(), 1.0 * strategy.num_replicas_in_sync) 111 self.assertEqual(3 * strategy.num_replicas_in_sync, x_s) 141 self.assertEqual(got, 1.0 * strategy.num_replicas_in_sync) 162 self.assertEqual(got, (1.0 * strategy.num_replicas_in_sync, 163 2.0 * strategy.num_replicas_in_sync)) 179 return strategy.num_replicas_in_sync
|
D | tpu_strategy_test.py | 452 self.assertEqual(sum_val, strategy.num_replicas_in_sync * 10) 598 strategy.num_replicas_in_sync * 2, 599 output_type=dtypes.float32).batch(strategy.num_replicas_in_sync) 610 expected_result = [[x + 2.] for x in range(0, strategy.num_replicas_in_sync) 620 strategy.num_replicas_in_sync, output_type=dtypes.float32).batch( 621 strategy.num_replicas_in_sync, drop_remainder=True) 648 data = range(0, strategy.num_replicas_in_sync) 651 [x + data_sum] for x in range(0, strategy.num_replicas_in_sync) 697 if strategy.num_replicas_in_sync != 2: 738 for replica in range(strategy.num_replicas_in_sync): [all …]
|
D | test_util_test.py | 53 self.evaluate(results), [1.] * strategy.num_replicas_in_sync) 70 self.evaluate(results['foo']), [1.] * strategy.num_replicas_in_sync) 72 self.evaluate(results['bar'][0]), [0.] * strategy.num_replicas_in_sync) 74 self.evaluate(results['bar'][1]), [1.] * strategy.num_replicas_in_sync)
|
D | input_lib.py | 67 num_replicas_in_sync=None, argument 100 num_replicas_in_sync=num_replicas_in_sync, 107 num_replicas_in_sync=num_replicas_in_sync, 966 num_replicas_in_sync=None, argument 1000 if num_replicas_in_sync is not None: 1004 num_replicas_in_sync) 1017 num_replicas_in_sync) 1030 num_replicas_in_sync) 1040 def _make_rebatch_fn(self, dataset, num_workers, num_replicas_in_sync): argument 1050 if num_replicas_in_sync % num_workers: [all …]
|
D | tpu_strategy_compilation_test.py | 77 expected_result_ones = [1 for _ in range(0, strategy.num_replicas_in_sync)] 81 expected_result_twos = [2 for _ in range(0, strategy.num_replicas_in_sync)]
|
D | tpu_strategy.py | 885 num_replicas_in_sync=self._num_replicas_in_sync) 899 num_replicas_in_sync=self._num_replicas_in_sync)) 949 num_replicas_in_sync=self._num_replicas_in_sync) 966 num_replicas_in_sync=self._num_replicas_in_sync)) 1454 for i in range(strategy.num_replicas_in_sync): 1564 [value for _ in range(self.num_replicas_in_sync)], axis=0) 1569 split_count=self.num_replicas_in_sync) 1575 for _ in range(self.num_replicas_in_sync) 1582 split_count=self.num_replicas_in_sync) 1586 num_or_size_splits=self.num_replicas_in_sync, [all …]
|
D | distribute_lib.py | 472 num_replicas_in_sync=1): argument 483 self._num_replicas_in_sync = num_replicas_in_sync 486 def num_replicas_in_sync(self): member in InputContext 564 num_replicas_in_sync=1): argument 573 self._num_replicas_in_sync = num_replicas_in_sync 576 def num_replicas_in_sync(self): member in ValueContext 588 .format(self.replica_id_in_sync_group, self.num_replicas_in_sync)) 791 self.num_replicas_in_sync) 1514 def num_replicas_in_sync(self): member in StrategyBase 2997 def num_replicas_in_sync(self): member in ReplicaContextBase [all …]
|
D | one_device_strategy_test.py | 126 dataset = dataset.batch(distribution.num_replicas_in_sync) 147 dataset = dataset.batch(distribution.num_replicas_in_sync)
|
D | distribute_lib_test.py | 563 num_input_pipelines=2, input_pipeline_id=1, num_replicas_in_sync=6) 564 self.assertEqual(6, input_context.num_replicas_in_sync) 570 num_input_pipelines=2, input_pipeline_id=1, num_replicas_in_sync=6) 577 num_input_pipelines=1, input_pipeline_id=0, num_replicas_in_sync=42) 582 num_input_pipelines=3, input_pipeline_id=1, num_replicas_in_sync=42)
|
D | custom_training_loop_input_test.py | 97 constant_op.constant(4., shape=(distribution.num_replicas_in_sync)), 270 for replica in range(distribution.num_replicas_in_sync): 395 data[0:distribution.num_replicas_in_sync]) 414 data[0:distribution.num_replicas_in_sync]) 862 for replica_id in range(distribution.num_replicas_in_sync): 870 for replica_id in range(1, distribution.num_replicas_in_sync): 960 if distribution.num_replicas_in_sync == 1:
|
/external/tensorflow/tensorflow/python/tpu/ |
D | tpu_outside_compilation_test.py | 152 constant_op.constant(35., shape=(strategy.num_replicas_in_sync))) 172 constant_op.constant(35., shape=(strategy.num_replicas_in_sync))) 193 constant_op.constant(36., shape=(strategy.num_replicas_in_sync))) 221 constant_op.constant(213., shape=(strategy.num_replicas_in_sync))) 248 constant_op.constant(21., shape=(strategy.num_replicas_in_sync))) 278 output_value, shape=(strategy.num_replicas_in_sync))) 300 constant_op.constant(58., shape=(strategy.num_replicas_in_sync))) 325 constant_op.constant(58., shape=(strategy.num_replicas_in_sync))) 350 constant_op.constant(7., shape=(strategy.num_replicas_in_sync))) 386 output_value, shape=(strategy.num_replicas_in_sync))) [all …]
|
D | tpu_embedding_v2_test.py | 79 self.num_rows = self.strategy.num_replicas_in_sync 192 self.strategy.num_replicas_in_sync * 2) 202 self.strategy.num_replicas_in_sync * 2) 213 self.assertAllClose(np.ones((self.strategy.num_replicas_in_sync * 2, 4)), 219 self.assertAllClose(np.ones((self.strategy.num_replicas_in_sync * 2, 4)), 498 num_replicas = strategy.num_replicas_in_sync 511 self.num_replicas = strategy.num_replicas_in_sync 995 num_replicas = strategy.num_replicas_in_sync 1072 self.batch_size * strategy.num_replicas_in_sync, drop_remainder=True) 1097 self.batch_size * strategy.num_replicas_in_sync, drop_remainder=True) [all …]
|
D | tpu_embedding_v2_correctness_test.py | 185 loss_per_replica = total_loss / strategy.num_replicas_in_sync 252 self.batch_size * strategy.num_replicas_in_sync, drop_remainder=True) 264 self.batch_size * strategy.num_replicas_in_sync, drop_remainder=True) 287 num_replicas = strategy.num_replicas_in_sync 487 num_replicas = strategy.num_replicas_in_sync
|
/external/tensorflow/tensorflow/python/training/experimental/ |
D | loss_scale_optimizer_test.py | 127 loss = lambda: grad_check_fn(var) / strategy.num_replicas_in_sync 142 self.assertEqual(loss_scale % strategy.num_replicas_in_sync, 0) 144 strategy, var, opt, loss_scale / strategy.num_replicas_in_sync) 172 learning_rate / strategy.num_replicas_in_sync) 181 loss_scale.initial_loss_scale % strategy.num_replicas_in_sync, 0) 195 strategy.num_replicas_in_sync)) 214 loss = lambda: var * 2.0 / strategy.num_replicas_in_sync 248 loss = lambda: var / strategy.num_replicas_in_sync
|
/external/tensorflow/tensorflow/tools/api/golden/v2/ |
D | tensorflow.distribute.experimental.-value-context.pbtxt | 6 name: "num_replicas_in_sync" 15 …argspec: "args=[\'self\', \'replica_id_in_sync_group\', \'num_replicas_in_sync\'], varargs=None, k…
|
D | tensorflow.distribute.-input-context.pbtxt | 14 name: "num_replicas_in_sync" 19 …args=[\'self\', \'num_input_pipelines\', \'input_pipeline_id\', \'num_replicas_in_sync\'], varargs…
|
/external/tensorflow/tensorflow/tools/api/golden/v1/ |
D | tensorflow.distribute.-input-context.pbtxt | 14 name: "num_replicas_in_sync" 19 …args=[\'self\', \'num_input_pipelines\', \'input_pipeline_id\', \'num_replicas_in_sync\'], varargs…
|
D | tensorflow.distribute.-replica-context.pbtxt | 11 name: "num_replicas_in_sync"
|
/external/tensorflow/tensorflow/python/keras/mixed_precision/ |
D | loss_scale_optimizer_test.py | 87 loss = lambda: grad_check_fn(var) / strategy.num_replicas_in_sync 103 self.assertEqual(loss_scale % strategy.num_replicas_in_sync, 0) 105 strategy, var, opt, loss_scale / strategy.num_replicas_in_sync) 179 strategy.num_replicas_in_sync) 190 self.assertEqual(opt.initial_scale % strategy.num_replicas_in_sync, 0) 202 2 * learning_rate / strategy.num_replicas_in_sync)) 229 self.assertEqual(opt.initial_scale % strategy.num_replicas_in_sync, 0) 231 loss = lambda: var * 4 / strategy.num_replicas_in_sync 270 loss = lambda: var * 2.0 / strategy.num_replicas_in_sync 301 return math_ops.cast(var / strategy.num_replicas_in_sync, 'float16') [all …]
|
D | layer_correctness_test.py | 190 assert global_batch_size % strategy.num_replicas_in_sync == 0, ( 192 '%d' % (strategy.num_replicas_in_sync, global_batch_size)) 194 global_batch_size // strategy.num_replicas_in_sync)
|
/external/tensorflow/tensorflow/python/keras/distribute/ |
D | distributed_training_utils_v1.py | 164 output_losses = output_losses[::strategy.num_replicas_in_sync] 165 metrics = metrics[::strategy.num_replicas_in_sync] 212 all_outputs = all_outputs[::distribution_strategy.num_replicas_in_sync] 517 global_batch_size *= distribution_strategy.num_replicas_in_sync 539 global_batch_size *= distribution_strategy.num_replicas_in_sync 552 if global_batch_size % distribution_strategy.num_replicas_in_sync: 556 global_batch_size, distribution_strategy.num_replicas_in_sync)) 557 batch_size = global_batch_size // distribution_strategy.num_replicas_in_sync 1045 num_replicas = strategy.num_replicas_in_sync
|
/external/tensorflow/tensorflow/python/keras/engine/ |
D | input_layer.py | 121 if batch_size % strategy.num_replicas_in_sync != 0: 124 batch_size, strategy.num_replicas_in_sync)) 125 batch_size = batch_size // strategy.num_replicas_in_sync
|