Home
last modified time | relevance | path

Searched refs:strategy (Results 1 – 25 of 639) sorted by relevance

12345678910>>...26

/external/tensorflow/tensorflow/python/distribute/
Dstrategy_gather_test.py45 strategy=[
62 strategy=[
73 strategy): argument
74 distributed_values = strategy.experimental_distribute_values_from_function(
78 return strategy.gather(distributed_values, axis=axis)
84 value_on_replica for _ in range(strategy.num_replicas_in_sync)
89 def testGatherPerReplicaDense1D0Axis(self, strategy, pure_eager): argument
93 self._gather_same_shape_and_verify(single_value, axis, pure_eager, strategy)
95 def testGatherPerReplicaDense2D0Axis(self, strategy, pure_eager): argument
99 self._gather_same_shape_and_verify(single_value, axis, pure_eager, strategy)
[all …]
Dstrategy_common_test.py46 strategy=[
53 def testCaptureReplicaId(self, strategy): argument
65 return strategy.run(f)
72 strategy=[
79 def testBasic(self, strategy): argument
80 per_replica_value = strategy.experimental_distribute_values_from_function(
85 return strategy.reduce(
91 with strategy.scope():
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)
[all …]
Dstrategy_combinations_test.py43 strategy=strategy_combinations.two_replica_strategies,
45 def testTwoReplicaStrategy(self, strategy): argument
46 with strategy.scope():
52 one_per_replica = strategy.run(one)
53 num_replicas = strategy.reduce(
59 strategy=strategy_combinations.four_replica_strategies,
61 def testFourReplicaStrategy(self, strategy): argument
62 with strategy.scope():
68 one_per_replica = strategy.run(one)
69 num_replicas = strategy.reduce(
[all …]
Dtpu_strategy_test.py84 strategy = tpu_lib.TPUStrategyV2(resolver)
85 strategy._enable_packed_variable_in_eager_mode = enable_packed_var
86 return strategy
172 strategy = get_tpu_strategy(enable_packed_var)
173 with strategy.scope():
185 strategy = get_tpu_strategy(enable_packed_var)
186 with strategy.scope():
203 strategy = tpu_lib.TPUStrategyV2(
205 strategy._enable_packed_variable_in_eager_mode = enable_packed_var
218 outputs = strategy.experimental_local_results(
[all …]
Dstrategy_test_lib.py341 self, strategy, input_fn, expected_values, ignore_order=False): argument
344 iterable = strategy.distribute_datasets_from_function(input_fn)
350 list(strategy.experimental_local_results(next(iterator))))
354 self.evaluate(strategy.experimental_local_results(next(iterator)))
361 list(strategy.experimental_local_results(next(iterator))))
365 self._test_input_fn_iterator(iterator, strategy.extended.worker_devices,
410 def _test_global_step_update(self, strategy): argument
411 with strategy.scope():
426 train_ops, value = strategy.extended.call_for_each_replica(model_fn)
427 self.evaluate(strategy.group(train_ops))
[all …]
Ddistribution_strategy_context.py44 self.strategy = dist
51 def __init__(self, strategy): argument
52 _ThreadMode.__init__(self, strategy, strategy, None)
58 _ThreadMode.__init__(self, replica_ctx.strategy, None, replica_ctx)
197 return _get_per_thread_mode().strategy
218 return (per_thread_mode.strategy, per_thread_mode.replica_context)
222 def experimental_set_strategy(strategy): argument
264 if strategy is not None:
265 new_scope = strategy.scope()
275 def enter_or_assert_strategy(strategy): argument
[all …]
Dparameter_server_strategy_v2_test.py61 strategy = parameter_server_strategy_v2.ParameterServerStrategyV2(
64 with strategy.scope():
95 strategy = parameter_server_strategy_v2.ParameterServerStrategyV2(
98 with strategy.scope():
105 strategy.run(step_fn, args=(iter(dataset),))
108 strategy = parameter_server_strategy_v2.ParameterServerStrategyV2(
111 strategy.reduce("SUM", None, axis=None)
114 strategy = parameter_server_strategy_v2.ParameterServerStrategyV2(
119 lambda: strategy.experimental_distribute_dataset(dataset))()
122 strategy = parameter_server_strategy_v2.ParameterServerStrategyV2(
[all …]
/external/tensorflow/tensorflow/python/keras/distribute/
Ddistributed_file_utils.py56 def _get_base_dirpath(strategy): argument
57 task_id = strategy.extended._task_id # pylint: disable=protected-access
61 def _is_temp_dir(dirpath, strategy): argument
62 return dirpath.endswith(_get_base_dirpath(strategy))
65 def _get_temp_dir(dirpath, strategy): argument
66 if _is_temp_dir(dirpath, strategy):
69 temp_dir = os.path.join(dirpath, _get_base_dirpath(strategy))
74 def write_dirpath(dirpath, strategy): argument
86 if strategy is None:
88 strategy = distribution_strategy_context.get_strategy()
[all …]
Ddistributed_file_utils_test.py60 strategy = DistributedFileUtilsTest.MockedChiefStrategy()
62 distributed_file_utils.write_filepath(filepath, strategy), filepath)
64 distributed_file_utils.write_dirpath(dirpath, strategy), dirpath)
69 strategy = DistributedFileUtilsTest.MockedWorkerStrategy()
71 distributed_file_utils.write_filepath(filepath, strategy),
74 distributed_file_utils.write_dirpath(dirpath, strategy),
79 strategy = DistributedFileUtilsTest.MockedChiefStrategy()
80 dir_to_write = distributed_file_utils.write_dirpath(temp_dir, strategy)
86 file_to_write, strategy)
91 strategy = DistributedFileUtilsTest.MockedWorkerStrategy()
[all …]
/external/squashfs-tools/squashfs-tools/
Dgzip_wrapper.c33 static struct strategy strategy[] = { variable
112 for(i = 0; strategy[i].name; i++) { in gzip_options()
113 int n = strlen(strategy[i].name); in gzip_options()
114 if((strncmp(name, strategy[i].name, n) == 0) && in gzip_options()
117 if(strategy[i].selected == 0) { in gzip_options()
118 strategy[i].selected = 1; in gzip_options()
125 if(strategy[i].name == NULL) { in gzip_options()
152 if(strategy_count == 1 && strategy[0].selected) { in gzip_options_post()
154 strategy[0].selected = 0; in gzip_options_post()
190 for(i = 0; strategy[i].name; i++) in gzip_dump_options()
[all …]
/external/tensorflow/tensorflow/python/tpu/
Dtpu_outside_compilation_test.py135 strategy = get_tpu_strategy()
148 return strategy.run(tpu_fn, args=(25.0,))
151 strategy.experimental_local_results(train_step()),
152 constant_op.constant(35., shape=(strategy.num_replicas_in_sync)))
155 strategy = get_tpu_strategy()
168 return strategy.run(tpu_fn, args=(25.0,))
171 strategy.experimental_local_results(train_step()),
172 constant_op.constant(35., shape=(strategy.num_replicas_in_sync)))
175 strategy = get_tpu_strategy()
189 return strategy.run(tpu_fn, args=(25.0,))
[all …]
Dtpu_embedding_v2_test.py78 self.strategy = tpu_strategy.TPUStrategy(self.resolver)
79 self.num_rows = self.strategy.num_replicas_in_sync
83 with self.strategy.scope():
190 with self.strategy.scope():
192 self.strategy.num_replicas_in_sync * 2)
200 with self.strategy.scope():
202 self.strategy.num_replicas_in_sync * 2)
207 with self.strategy.scope():
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)),
[all …]
Dtpu_embedding_v2_correctness_test.py135 strategy = self._get_strategy()
137 with strategy.scope():
148 return strategy, mid_level_api, optimizer
156 strategy, mid_level_api, optimizer = (
160 dataset = self._create_sparse_dataset(strategy)
162 dataset = self._create_ragged_dataset(strategy)
164 dist = strategy.experimental_distribute_dataset(
185 loss_per_replica = total_loss / strategy.num_replicas_in_sync
192 result = strategy.run(step)
202 input_data = next(iter(self._create_sparse_dataset(strategy)))
[all …]
/external/jacoco/org.jacoco.core.test/src/org/jacoco/core/internal/instr/
DProbeArrayStrategyFactoryTest.java51 final IProbeArrayStrategy strategy = test(Opcodes.V1_1, 0, false, true, in testClass1() local
53 assertEquals(ClassFieldProbeArrayStrategy.class, strategy.getClass()); in testClass1()
60 final IProbeArrayStrategy strategy = test(Opcodes.V1_2, 0, false, true, in testClass2() local
62 assertEquals(ClassFieldProbeArrayStrategy.class, strategy.getClass()); in testClass2()
69 final IProbeArrayStrategy strategy = test(Opcodes.V1_3, 0, false, true, in testClass3() local
71 assertEquals(ClassFieldProbeArrayStrategy.class, strategy.getClass()); in testClass3()
78 final IProbeArrayStrategy strategy = test(Opcodes.V1_4, 0, false, true, in testClass4() local
80 assertEquals(ClassFieldProbeArrayStrategy.class, strategy.getClass()); in testClass4()
87 final IProbeArrayStrategy strategy = test(Opcodes.V1_5, 0, false, true, in testClass5() local
89 assertEquals(ClassFieldProbeArrayStrategy.class, strategy.getClass()); in testClass5()
[all …]
/external/perfetto/src/traced/probes/ftrace/
Devent_info_unittest.cc50 ASSERT_FALSE(field.strategy); in TEST()
67 ASSERT_FALSE(field.strategy); in TEST()
73 TranslationStrategy strategy = kUint32ToUint32; in TEST() local
75 &strategy)); in TEST()
76 ASSERT_EQ(strategy, kUint32ToUint32); in TEST()
78 &strategy)); in TEST()
79 ASSERT_EQ(strategy, kCStringToString); in TEST()
81 SetTranslationStrategy(kFtracePid32, ProtoSchemaType::kInt32, &strategy)); in TEST()
82 ASSERT_EQ(strategy, kPid32ToInt32); in TEST()
84 &strategy)); in TEST()
[all …]
/external/tensorflow/tensorflow/python/distribute/integration_test/
Dsaved_model_test.py51 strategy=[
78 def test_read_sync_on_read_variable(self, strategy): argument
95 with strategy.scope():
101 self.evaluate(strategy.experimental_local_results(m.v)), [0.5, 0.5])
109 def test_read_mirrored_variable(self, strategy): argument
126 with strategy.scope():
134 def test_update_sync_on_read_variable(self, strategy): argument
153 with strategy.scope():
161 def test_update_mirrored_variable(self, strategy): argument
178 with strategy.scope():
[all …]
Dmwms_peer_failure_test.py44 def get_attempt(strategy, attempts): argument
45 task_type = strategy.cluster_resolver.task_type
46 task_id = strategy.cluster_resolver.task_id
80 strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy()
81 with strategy.scope():
84 if strategy.cluster_resolver.task_id == 1:
114 strategy = tf.distribute.experimental.MultiWorkerMirroredStrategy()
116 strategy.reduce("sum", value, axis=None)
118 if strategy.cluster_resolver.task_id == 1:
120 strategy.reduce("sum", value, axis=None)
[all …]
/external/glide/library/src/main/java/com/bumptech/glide/load/engine/bitmap_recycle/
DLruBitmapPool.java24 private final LruPoolStrategy strategy; field in LruBitmapPool
36 LruBitmapPool(int maxSize, LruPoolStrategy strategy) { in LruBitmapPool() argument
39 this.strategy = strategy; in LruBitmapPool()
65 if (!bitmap.isMutable() || strategy.getSize(bitmap) > maxSize) { in put()
67 Log.v(TAG, "Reject bitmap from pool=" + strategy.logBitmap(bitmap) + " is mutable=" in put()
73 final int size = strategy.getSize(bitmap); in put()
74 strategy.put(bitmap); in put()
81 Log.v(TAG, "Put bitmap in pool=" + strategy.logBitmap(bitmap)); in put()
111 final Bitmap result = strategy.get(width, height, config != null ? config : DEFAULT_CONFIG); in getDirty()
114 Log.d(TAG, "Missing bitmap=" + strategy.logBitmap(width, height, config)); in getDirty()
[all …]
/external/objenesis/main/src/main/java/org/objenesis/
DObjenesisBase.java19 import org.objenesis.strategy.InstantiatorStrategy;
32 protected final InstantiatorStrategy strategy; field in ObjenesisBase
42 public ObjenesisBase(InstantiatorStrategy strategy) { in ObjenesisBase() argument
43 this(strategy, true); in ObjenesisBase()
52 public ObjenesisBase(InstantiatorStrategy strategy, boolean useCache) { in ObjenesisBase() argument
53 if(strategy == null) { in ObjenesisBase()
56 this.strategy = strategy; in ObjenesisBase()
62 return getClass().getName() + " using " + strategy.getClass().getName() in toString()
90 return strategy.newInstantiatorOf(clazz); in getInstantiatorOf()
94 ObjectInstantiator<?> newInstantiator = strategy.newInstantiatorOf(clazz); in getInstantiatorOf()
/external/guava/android/guava/src/com/google/common/hash/
DBloomFilter.java109 private final Strategy strategy; field in BloomFilter
113 LockFreeBitArray bits, int numHashFunctions, Funnel<? super T> funnel, Strategy strategy) { in BloomFilter() argument
120 this.strategy = checkNotNull(strategy); in BloomFilter()
130 return new BloomFilter<T>(bits.copy(), numHashFunctions, funnel, strategy); in copy()
138 return strategy.mightContain(object, funnel, numHashFunctions, bits); in mightContain()
164 return strategy.put(object, funnel, numHashFunctions, bits); in put()
230 && this.strategy.equals(that.strategy) in isCompatible()
257 this.strategy.equals(that.strategy), in putAll()
259 this.strategy, in putAll()
260 that.strategy); in putAll()
[all …]
/external/tensorflow/tensorflow/python/training/experimental/
Dloss_scale_optimizer_test.py124 def _run_fn_with_grad_check(self, strategy, var, opt, expected_grad): argument
127 loss = lambda: grad_check_fn(var) / strategy.num_replicas_in_sync
133 with strategy_fn().scope() as strategy:
142 self.assertEqual(loss_scale % strategy.num_replicas_in_sync, 0)
144 strategy, var, opt, loss_scale / strategy.num_replicas_in_sync)
145 run_op = strategy.experimental_run(run_fn)
169 strategy = strategy_fn()
172 learning_rate / strategy.num_replicas_in_sync)
173 with strategy.scope():
181 loss_scale.initial_loss_scale % strategy.num_replicas_in_sync, 0)
[all …]
Dloss_scaling_gradient_tape_test.py53 def _run_with_strategy(self, run_fn, strategy, use_tf_function=False): argument
69 strategy_fn = lambda: strategy.run(run_fn)
77 return strategy.experimental_local_results(tensor)
90 strategy = strategy_fn()
91 with strategy.scope():
97 dy_dx_list = self._run_with_strategy(run_fn, strategy, use_tf_function)
110 strategy = strategy_fn()
111 with strategy.scope():
117 dy_dx_list = self._run_with_strategy(run_fn, strategy, use_tf_function)
131 strategy = strategy_fn()
[all …]
/external/guava/guava/src/com/google/common/hash/
DBloomFilter.java110 private final Strategy strategy; field in BloomFilter
114 LockFreeBitArray bits, int numHashFunctions, Funnel<? super T> funnel, Strategy strategy) { in BloomFilter() argument
121 this.strategy = checkNotNull(strategy); in BloomFilter()
131 return new BloomFilter<T>(bits.copy(), numHashFunctions, funnel, strategy); in copy()
139 return strategy.mightContain(object, funnel, numHashFunctions, bits); in mightContain()
165 return strategy.put(object, funnel, numHashFunctions, bits); in put()
231 && this.strategy.equals(that.strategy) in isCompatible()
258 this.strategy.equals(that.strategy), in putAll()
260 this.strategy, in putAll()
261 that.strategy); in putAll()
[all …]
/external/autotest/client/common_lib/hosts/
Drepair_unittest.py1024 strategy = hosts.RepairStrategy(verify_data, [], 'unittest')
1027 strategy._verify_root._dependency_list,
1043 strategy = hosts.RepairStrategy(verify_data, [], 'unittest')
1047 strategy._verify_root._dependency_list, [parent])
1068 strategy = hosts.RepairStrategy(verify_data, [], 'unittest')
1073 strategy._verify_root._dependency_list,
1100 strategy = hosts.RepairStrategy(verify_data, [], 'unittest')
1105 strategy._verify_root._dependency_list,
1124 strategy = hosts.RepairStrategy(verify_data, [], 'unittest')
1130 strategy.verify(self._fake_host, silent)
[all …]
/external/tensorflow/tensorflow/python/keras/mixed_precision/
Dloss_scale_optimizer_test.py84 def _run_fn_with_grad_check(self, strategy, var, opt, expected_grad): argument
87 loss = lambda: grad_check_fn(var) / strategy.num_replicas_in_sync
92 with strategy_fn().scope() as strategy:
103 self.assertEqual(loss_scale % strategy.num_replicas_in_sync, 0)
105 strategy, var, opt, loss_scale / strategy.num_replicas_in_sync)
106 run_op = strategy.experimental_run(run_fn)
176 strategy = strategy_fn()
179 strategy.num_replicas_in_sync)
180 with strategy.scope():
190 self.assertEqual(opt.initial_scale % strategy.num_replicas_in_sync, 0)
[all …]

12345678910>>...26