Home
last modified time | relevance | path

Searched refs:num_replicas_in_sync (Results 1 – 25 of 73) sorted by relevance

123

/external/tensorflow/tensorflow/python/distribute/
Dinput_ops.py30 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)
Dinput_lib_test.py69 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 …]
Dstrategy_gather_test.py84 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 …]
Dstrategy_common_test.py92 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
Dtpu_strategy_test.py452 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 …]
Dtest_util_test.py53 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)
Dinput_lib.py67 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 …]
Dtpu_strategy_compilation_test.py77 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)]
Dtpu_strategy.py885 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 …]
Ddistribute_lib.py472 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 …]
Done_device_strategy_test.py126 dataset = dataset.batch(distribution.num_replicas_in_sync)
147 dataset = dataset.batch(distribution.num_replicas_in_sync)
Ddistribute_lib_test.py563 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)
Dcustom_training_loop_input_test.py97 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/
Dtpu_outside_compilation_test.py152 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 …]
Dtpu_embedding_v2_test.py79 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 …]
Dtpu_embedding_v2_correctness_test.py185 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/
Dloss_scale_optimizer_test.py127 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/
Dtensorflow.distribute.experimental.-value-context.pbtxt6 name: "num_replicas_in_sync"
15 …argspec: "args=[\'self\', \'replica_id_in_sync_group\', \'num_replicas_in_sync\'], varargs=None, k…
Dtensorflow.distribute.-input-context.pbtxt14 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/
Dtensorflow.distribute.-input-context.pbtxt14 name: "num_replicas_in_sync"
19 …args=[\'self\', \'num_input_pipelines\', \'input_pipeline_id\', \'num_replicas_in_sync\'], varargs…
Dtensorflow.distribute.-replica-context.pbtxt11 name: "num_replicas_in_sync"
/external/tensorflow/tensorflow/python/keras/mixed_precision/
Dloss_scale_optimizer_test.py87 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 …]
Dlayer_correctness_test.py190 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/
Ddistributed_training_utils_v1.py164 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/
Dinput_layer.py121 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

123