Home
last modified time | relevance | path

Searched +full:self +full:- +full:assign (Results 1 – 25 of 1055) sorted by relevance

12345678910>>...43

/external/tensorflow/tensorflow/python/distribute/
Dmoving_averages_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
53 def testReplicaModeWithoutZeroDebias(self, distribution): argument
58 val = constant_op.constant([1.0 + replica_id[0], 2.0 - replica_id[0]])
61 assign = moving_averages.assign_moving_average(
63 return var, assign
66 var, assign = distribution.extended.call_for_each_replica(replica_fn)
67 self.evaluate(variables.global_variables_initializer())
68 self.assertAllClose([10.0, 11.0], self.evaluate(var))
69 self.evaluate(distribution.experimental_local_results(assign))
71 average_val = [1.0 + 0.5 * (replica_id[0] - 1),
[all …]
Dvars_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
50 # TODO(b/197981388): re-enable MWMS test
72 # TODO(b/197981388): re-enable MWMS test
85 def testAssign(self, distribution, experimental_run_tf_function): argument
87 def assign(fn, v, update_value, cross_replica): function
96 updates = [("assign", 1.), ("assign_add", 1.), ("assign_sub", -1.)]
106 # assign in replica context with SUM does not make sense cause you can
116 self.evaluate(variables_lib.global_variables_initializer())
118 self.evaluate(assign(fn, v, update_value, cross_replica))
120 self.assertAllEqual(self.evaluate(component.read_value()),
[all …]
Ddistributed_variable_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
100 def testExtendsVariable(self, distribution, synchronization, aggregation): argument
104 self.assertIsInstance(v, variables_lib.Variable)
106 def testCheckpointing(self, distribution, synchronization, aggregation, mode): argument
111 self.skipTest("MWMS combinations tests do not work well in graph mode.")
119 self.evaluate(v.initializer)
120 before_save = self.evaluate(v.read_value())
124 prefix = os.path.join(self.get_temp_dir(), "ckpt")
125 with self.test_session():
128 # Assign inverted value.
[all …]
Dtpu_values.py7 # http://www.apache.org/licenses/LICENSE-2.0
43 def __init__(self, *args, **kwargs): argument
44 super(TPUVariableMixin, self).__init__(*args, **kwargs)
49 self._handle_id = self._common_name + "_" + str(id(self._primary))
51 self._handle_id = self._common_name
53 def __getattr__(self, name): argument
55 return super(TPUVariableMixin, self).__getattr__(name)
60 def get(self): argument
62 return super(TPUVariableMixin, self).get()
67 def _get_as_operand(self): argument
[all …]
Dvalues_v2_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
41 def create_variable(self, initial_value=1., **kwargs): argument
45 def devices(self): argument
52 def testStringify(self): argument
53 v = self.create_variable()
54 self.assertIsInstance(v.__str__(), str)
55 self.assertIsInstance(v.__repr__(), str)
57 def testDenseRead(self): argument
58 v = self.create_variable(1.)
59 self.assertEqual(v.value(), 1.)
[all …]
/external/python/cpython2/Lib/compiler/
Dsymbols.py1 """Module symbol-table generator"""
16 def __init__(self, name, module, klass=None): argument
17 self.name = name
18 self.module = module
19 self.defs = {}
20 self.uses = {}
21 self.globals = {}
22 self.params = {}
23 self.frees = {}
24 self.cells = {}
[all …]
/external/tensorflow/tensorflow/python/debug/lib/
Ddebug_utils_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
24 # Import resource_variable_ops for the variables-to-tensor implicit conversion.
25 from tensorflow.python.ops import resource_variable_ops # pylint: disable=unused-import
37 cls._a_init_val = np.array([[5.0, 3.0], [-1.0, 0.0]])
38 cls._b_init_val = np.array([[2.0], [-1.0]])
39 cls._c_val = np.array([[-4.0], [np.nan]])
59 # - Two variables (a, b), each with four nodes (Variable, init, Assign,
61 # - One constant (c).
62 # - One add operation and one matmul operation.
63 # - One wildcard node name ("*") that covers nodes created internally
[all …]
/external/tensorflow/tensorflow/python/checkpoint/
Dcheckpoint_with_v1_optimizers_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
15 """Tests for object-based saving which use tf.train.* optimizers."""
36 def testDeferredSlotRestoration(self): argument
37 checkpoint_directory = self.get_temp_dir()
48 # `root`. Create a one-off grouping so that slot variables for `root.var`
50 self.evaluate(trackable_utils.gather_initializers(
52 self.evaluate(train_op)
53 self.evaluate(state_ops.assign(root.var, 12.))
56 self.evaluate(state_ops.assign(root.var, 13.))
57 self.evaluate(state_ops.assign(optimizer.get_slot(name="m", var=root.var),
[all …]
Dcheckpoint_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
53 def __init__(self): argument
55 self.a_variable = trackable_utils.add_variable(
56 self, name="a_variable", shape=[])
62 def testAddVariable(self): argument
64 with self.assertRaisesRegex(ValueError, "do not specify shape"):
88 with self.assertRaisesRegex(ValueError, "'duplicate'.*already declared"):
91 self.evaluate(trackable_utils.gather_initializers(obj))
92 self.assertEqual("constant_initializer:0", constant_initializer.name)
93 self.assertEqual(1, self.evaluate(constant_initializer))
[all …]
Dfunctional_saver_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
40 def setUp(self): argument
41 super(SaverTest, self).setUp()
49 self.local_options = checkpoint_options.CheckpointOptions(
53 def test_resource_variable(self): argument
55 self.evaluate(v1.initializer)
58 prefix = os.path.join(self.get_temp_dir(), "ckpt")
59 self.evaluate(saver.save(constant_op.constant(prefix)))
60 self.assertEqual(2, len(gfile.Glob(prefix + "*")))
61 self.evaluate(v1.assign(1.))
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/variables/
Dvariable_ops_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
44 def _initFetch(self, x, tftype, use_gpu=None): argument
45 with self.test_session(use_gpu=use_gpu):
47 op = state_ops.assign(p, x)
49 return self.evaluate(p)
51 def _testTypes(self, vals): argument
56 self.setUp()
59 self.assertAllEqual(x, self._initFetch(x, tftype, use_gpu=False))
62 # that Variable and Assign have GPU implementations for matching tf.
63 self.assertAllEqual(x, self._initFetch(x, tftype, use_gpu=True))
[all …]
Ddense_update_ops_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
15 """Tests for tensorflow.ops.tf.Assign*."""
27 def _initAssignFetch(self, x, y, use_gpu): argument
29 super(AssignOpTest, self).setUp()
32 assign = state_ops.assign(p, y)
33 self.evaluate(p.initializer)
34 new_value = self.evaluate(assign)
35 return self.evaluate(p), new_value
37 def _initAssignAddFetch(self, x, y, use_gpu): argument
42 self.evaluate(p.initializer)
[all …]
/external/clang/test/Analysis/
Dobjc_invalidation.m1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.InstanceVariableInvalidation -DR…
2 // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.osx.cocoa.MissingInvalidationMethod -DRUN_…
15 -(id)init;
16 -(id)autorelease;
17 -(id)copy;
18 - (Class)class;
19 -(id)retain;
20 -(id)description;
27 - (void) invalidate __attribute__((annotate("objc_instance_variable_invalidator")));
31 - (void) invalidate __attribute__((annotate("objc_instance_variable_invalidator")));
[all …]
DPR2978.m1 // RUN: %clang_cc1 -analyze -analyzer-checker=core,alpha.core,osx.cocoa.Dealloc %s -verify
7 - (void)release;
8 - (void)dealloc;
33 @property(assign) id Z;
34 @property(assign) id K;
43 @property(assign, readonly) id T; // Shadowed in class extension
44 @property(assign) id U;
48 -(id) O;
49 -(void) setO: (id) arg;
54 @property(assign, readwrite) id T; category
[all …]
/external/tensorflow/tensorflow/python/keras/
Doptimizer_v1.py7 # http://www.apache.org/licenses/LICENSE-2.0
15 # pylint: disable=invalid-name
16 # pylint: disable=g-classes-have-attributes
48 def __init__(self, **kwargs): argument
57 self.__dict__.update(kwargs)
58 self.updates = []
59 self.weights = []
65 def _create_all_weights(self, params): argument
77 def get_updates(self, loss, params): argument
80 def get_gradients(self, loss, params): argument
[all …]
/external/python/cpython3/Lib/test/
Dtest_syntax.py12 raise these exceptions-- ast.c, compile.c, future.c, pythonrun.c, and
36 SyntaxError: cannot assign to None
44 SyntaxError: cannot assign to True
52 SyntaxError: cannot assign to __debug__
56 SyntaxError: cannot assign to __debug__
60 SyntaxError: cannot assign to __debug__
68 SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?
80 SyntaxError: cannot assign to expression here. Maybe you meant '==' instead of '='?
84 SyntaxError: cannot assign to generator expression
88 SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
[all …]
/external/tensorflow/tensorflow/python/framework/
Dauto_control_deps_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
43 def setUp(self): argument
45 self.must_run_order_insensitive_stateful_ops = (
48 def tearDown(self): argument
50 self.must_run_order_insensitive_stateful_ops)
53 def testBasic(self): argument
54 with context.graph_mode(), self.cached_session():
56 self.evaluate(variables.global_variables_initializer())
58 v.assign(v + 1)
59 v.assign(2 * v)
[all …]
/external/autotest/server/cros/network/
Dip_config_context_manager.py3 # Use of this source code is governed by a BSD-style license that can be
14 def bring_interface_up(self, host, dev_name): argument
23 if host in self._iface_cleanup_dict:
24 self._iface_cleanup_dict[host].append(clear_command)
26 self._iface_cleanup_dict[host] = [clear_command]
29 def add_ip_route(self, host, dest_ip, iface_name, via_ip=None): argument
33 @param host Host Device to assign the ip route on.
42 if host in self._ip_route_cleanup_dict:
43 self._ip_route_cleanup_dict[host].append(clear_command)
45 self._ip_route_cleanup_dict[host] = [clear_command]
[all …]
/external/clang/test/SemaObjC/
Dproperty-deprecated-warning.m1 // RUN: %clang_cc1 -fsyntax-only -triple thumbv6-apple-ios3.0 -verify -Wno-objc-root-class %s
2 // RUN: %clang_cc1 -D WARN_PARTIAL -Wpartial-availability -fsyntax-only -triple thumbv6-apple-ios3.…
3 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -triple thumbv6-apple-ios3.0 -verify -Wno-objc-ro…
9assign) id ptarget __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-n…
12 // expected-note@+2 {{property 'partialPtarget' is declared partial here}} expected-note@+2 {{'part…
14 @property(nonatomic,assign) id partialPtarget __attribute__((availability(ios,introduced=5.0)));
18 - (void)setPtarget:(id)arg;
19 - (void)setPartialPtarget:(id)arg;
24assign) id target __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-no…
27 // expected-note@+2 {{property 'partialTarget' is declared partial here}} expected-note@+2 {{'setPa…
[all …]
/external/tensorflow/tensorflow/python/ops/
Dvariables.py7 # http://www.apache.org/licenses/LICENSE-2.0
24 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
103 (called "replicas") acting data-parallel on different elements of the input
104 batch. When performing some variable-update operation, say
109 variable-update operation with multiple replicas.
121 def __hash__(self): argument
122 return hash(self.value)
124 def __eq__(self, other): argument
125 if self is other:
128 return int(self.value) == int(other.value)
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/v1_compat_tests/
Ddense_update_ops_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
26 @test_util.run_v1_only("Non-strict shape assignment only in V1.")
27 # Bypassing Shape validation in assign with validate_shape only works in V1.
29 # ValueError: Cannot assign value to variable ' Variable:0': Shape mismatch.
33 def testAssignNonStrictShapeChecking(self): argument
36 a = state_ops.assign(p, data, validate_shape=False)
37 self.evaluate(a)
38 self.assertAllEqual(p, self.evaluate(data))
40 # Assign to yet another shape
42 a2 = state_ops.assign(p, data2, validate_shape=False)
[all …]
/external/tensorflow/tensorflow/python/keras/optimizer_v2/
Dnadam.py7 # http://www.apache.org/licenses/LICENSE-2.0
16 # pylint: disable=g-classes-have-attributes
59 - [Dozat, 2015](http://cs229.stanford.edu/proj2015/054_report.pdf).
64 def __init__(self, argument
68 epsilon=1e-7,
79 super(Nadam, self).__init__(name, **kwargs)
80 self._set_hyper('learning_rate', kwargs.get('lr', learning_rate))
81 self._set_hyper('decay', self._initial_decay)
82 self._set_hyper('beta_1', beta_1)
83 self._set_hyper('beta_2', beta_2)
[all …]
/external/rust/crates/h2/src/proto/streams/
Dprioritize.rs11 cmp::{self, Ordering},
19 /// lower-numbered streams are sent headers before higher-numbered ones.
23 /// IDs, some mechanism would be necessary to ensure that the lowest-numbered]
84 pub fn new(config: &Config) -> Prioritize { in new()
107 pub(crate) fn max_buffer_size(&self) -> usize { in max_buffer_size()
108 self.max_buffer_size in max_buffer_size()
113 &mut self, in queue_frame() argument
123 self.schedule_send(stream, task); in queue_frame()
126 pub fn schedule_send(&mut self, stream: &mut store::Ptr, task: &mut Option<Waker>) { in schedule_send() argument
131 self.pending_send.push(stream); in schedule_send()
[all …]
/external/libaom/tools/auto_refactor/
Dauto_refactor.py28 def __init__(self, argument
33 self.typedef_name = typedef_name
34 self.struct_name = struct_name
35 self.struct_node = struct_node
36 self.is_union = is_union
37 self.child_decl_map = None
39 def __str__(self): argument
40 return str(self.typedef_name) + ' ' + str(self.struct_name) + ' ' + str(
41 self.is_union)
43 def compute_child_decl_map(self, struct_info): argument
[all …]
/external/tensorflow/tensorflow/python/training/saving/
Dsaveable_object_util_test.py7 # http://www.apache.org/licenses/LICENSE-2.0
35 def __init__(self, var, slice_spec, name): argument
39 def restore(self, restored_tensors, restored_shapes): argument
40 return self.op.assign(restored_tensors[0])
45 def test_convert_no_saveable(self): argument
48 self.assertEmpty(converter._serialize_to_tensors())
51 with self.assertRaisesRegex(ValueError, "Could not restore object"):
54 def test_convert_single_saveable(self): argument
58 def __init__(self): argument
59 self.a = variables.Variable(5.0)
[all …]

12345678910>>...43