Home
last modified time | relevance | path

Searched refs:test_fn (Results 1 – 25 of 68) sorted by relevance

123

/external/tensorflow/tensorflow/python/autograph/converters/
Dreturn_statements_test.py29 def assertTransformedEquivalent(self, test_fn, *inputs): argument
31 with self.converted(test_fn, return_statements, ns) as result:
32 self.assertEqual(test_fn(*inputs), result.test_fn(*inputs))
36 def test_fn(x): function
39 self.assertTransformedEquivalent(test_fn, 2)
43 def test_fn(x): function
49 self.assertTransformedEquivalent(test_fn, 2)
50 self.assertTransformedEquivalent(test_fn, -2)
54 def test_fn(x): function
58 self.assertTransformedEquivalent(test_fn, 2)
[all …]
Dcontinue_statements_test.py30 def assertTransformedEquivalent(self, test_fn, *inputs): argument
31 with self.converted(test_fn, continue_statements, {'ops': ops},
33 self.assertEqual(test_fn(*inputs), result.test_fn(*inputs))
37 def test_fn(x): function
46 self.assertTransformedEquivalent(test_fn, 0)
47 self.assertTransformedEquivalent(test_fn, 1)
48 self.assertTransformedEquivalent(test_fn, 3)
49 self.assertTransformedEquivalent(test_fn, 4)
53 def test_fn(a): function
62 self.assertTransformedEquivalent(test_fn, [])
[all …]
Dcontrol_flow_test.py33 def assertTransformedResult(self, test_fn, inputs, expected, symbols=None): argument
38 with self.converted(test_fn, control_flow, symbols,
40 self.assertEqual(self.evaluate(result.test_fn(*inputs)), expected)
45 def test_fn(n): function
53 self.assertTransformedResult(test_fn, constant_op.constant(5), (10, 5, 5))
58 def test_fn(n): function
71 self.assertTransformedResult(test_fn, constant_op.constant(5),
77 def test_fn(n): function
82 self.assertTransformedResult(test_fn, constant_op.constant(5), 0)
91 def test_fn(n): function
[all …]
Dbreak_statements_test.py29 def assertTransformedEquivalent(self, test_fn, *inputs): argument
30 with self.converted(test_fn, break_statements, {},
32 self.assertEqual(test_fn(*inputs), result.test_fn(*inputs))
36 def test_fn(x): function
45 self.assertTransformedEquivalent(test_fn, 0)
46 self.assertTransformedEquivalent(test_fn, 1)
47 self.assertTransformedEquivalent(test_fn, 4)
51 def test_fn(a): function
60 with self.converted(test_fn, break_statements, {},
64 self.assertEqual([3], result.test_fn([5, 4]))
[all …]
Dlogical_expressions_test.py33 def test_fn(a, b): function
36 with self.converted(test_fn, logical_expressions, {}) as result:
38 self.assertTrue(sess.run(result.test_fn(constant_op.constant(1), 1)))
39 self.assertFalse(sess.run(result.test_fn(constant_op.constant(1), 2)))
44 def test_fn(a, b, c): function
47 with self.converted(test_fn, logical_expressions, {}) as result:
50 sess.run(result.test_fn(constant_op.constant(True), False, False)))
52 sess.run(result.test_fn(constant_op.constant(True), False, True)))
57 def test_fn(a, b, c, d): function
60 with self.converted(test_fn, logical_expressions, {}) as result:
[all …]
Dlist_comprehensions_test.py28 def assertTransformedEquivalent(self, test_fn, *inputs): argument
29 with self.converted(test_fn, list_comprehensions, {}) as result:
30 self.assertEqual(test_fn(*inputs), result.test_fn(*inputs))
34 def test_fn(l): function
38 self.assertTransformedEquivalent(test_fn, [])
39 self.assertTransformedEquivalent(test_fn, [1, 2, 3])
43 def test_fn(l): function
47 self.assertTransformedEquivalent(test_fn, [])
48 self.assertTransformedEquivalent(test_fn, [[1], [2], [3]])
52 def test_fn(l): function
[all …]
Dlists_test.py41 def test_fn(): function
44 with self.converted(test_fn, lists, {}) as result:
45 tl = result.test_fn()
52 def test_fn(): function
55 with self.converted(test_fn, lists, {}) as result:
56 self.assertAllEqual(result.test_fn(), [1, 2, 3])
60 def test_fn(): function
67 with self.converted(test_fn, lists, ns) as result:
69 tl = result.test_fn()
75 def test_fn(): function
[all …]
Dcall_trees_test.py30 def test_fn(f): function
33 with self.converted(test_fn, call_trees, {}) as result:
35 result.test_fn(None),
41 def test_fn(f, a, b): function
44 with self.converted(test_fn, call_trees, {}) as result:
46 result.test_fn(None, 1, 2),
52 def test_fn(f, a, *args, **kwargs): function
55 with self.converted(test_fn, call_trees, {}) as result:
57 result.test_fn(None, 1, *[2, 3], **{'b': 4, 'c': 5}),
66 def test_fn(): function
[all …]
Dconditional_expressions_test.py28 def assertTransformedEquivalent(self, test_fn, *inputs): argument
30 with self.converted(test_fn, conditional_expressions, ns) as result:
31 self.assertEqual(test_fn(*inputs), result.test_fn(*inputs))
35 def test_fn(x): function
38 self.assertTransformedEquivalent(test_fn, 0)
39 self.assertTransformedEquivalent(test_fn, 3)
43 def test_fn(x): function
47 self.assertTransformedEquivalent(test_fn, -2)
48 self.assertTransformedEquivalent(test_fn, 0)
49 self.assertTransformedEquivalent(test_fn, 2)
Dfunction_scopes_test.py34 def test_fn(l): function
40 with self.converted(test_fn, function_scopes, {}) as result:
41 result_op = result.test_fn(constant_op.constant(1))
43 self.assertEqual('Docstring.', result.test_fn.__doc__)
50 def test_fn(): function
57 with self.converted(test_fn, function_scopes, {},
59 result_op = result.test_fn()
61 self.assertIn('First sentence.', result.test_fn.__doc__)
62 self.assertIn('Second sentence.', result.test_fn.__doc__)
67 def test_fn(l): function
[all …]
Dbuiltin_functions_test.py37 def test_fn(a): function
40 with self.converted(test_fn, builtin_functions, {'len': len}) as result:
43 ops = result.test_fn(p)
52 def test_fn(a): function
55 with self.converted(test_fn, builtin_functions, {'print': print}) as result:
58 sess.run(result.test_fn(constant_op.constant('a')))
60 result.test_fn('a')
68 def test_fn(a, b, c): function
71 with self.converted(test_fn, builtin_functions, {'print': print}) as result:
75 result.test_fn(
[all …]
Dside_effect_guards_test.py41 def test_fn(a): function
45 node, ctx = self.prepare(test_fn, {})
54 self.evaluate(result.test_fn(v))
62 def test_fn(a): function
66 node, ctx = self.prepare(test_fn, {})
75 self.evaluate(result.test_fn(v))
83 def test_fn(a): function
87 node, ctx = self.prepare(test_fn, {})
96 sess.run(result.test_fn(constant_op.constant(-1)))
100 def test_fn(a): function
[all …]
Darg_defaults_test.py34 def test_fn(): function
37 node, ctx = self.prepare(test_fn, {})
43 def test_fn(a, b, *c, **e): function
46 node, ctx = self.prepare(test_fn, {})
54 def test_fn(a, b=1, c=2): function
57 node, ctx = self.prepare(test_fn, {})
63 def test_fn(a, b=1, *c): # pylint: disable=keyword-arg-before-vararg function
66 node, ctx = self.prepare(test_fn, {})
Derror_handlers_test.py34 def test_fn(): function
37 with self.converted(test_fn, error_handlers, {}) as result:
40 result.test_fn()
44 def test_fn(x): function
47 node, ctx = self.prepare(test_fn, {})
Ddirectives_test.py34 def test_fn(): function
39 node, ctx = self.prepare(test_fn, {'directives': directives})
50 def test_fn(a): function
53 node, ctx = self.prepare(test_fn, {'directives': directives})
63 def test_fn(): function
68 node, ctx = self.prepare(test_fn, {'directives': directives})
/external/tensorflow/tensorflow/python/autograph/pyct/
Dcfg_test.py49 def test_fn(a): function
56 graphs, node = self._build_cfg(test_fn)
71 def test_fn(a): function
78 graphs, node = self._build_cfg(test_fn)
146 def test_fn(a): function
152 graph, = self._build_cfg(test_fn).values()
166 def test_fn(a, b): function
170 graph, = self._build_cfg(test_fn).values()
182 def test_fn(a): function
186 graph, = self._build_cfg(test_fn).values()
[all …]
Dorigin_info_test.py32 def test_fn(x): function
35 node, _, _ = parser.parse_entity(test_fn)
53 def test_fn(x): function
56 node, _, _ = parser.parse_entity(test_fn)
66 def test_fn(x): function
70 node, source, _ = parser.parse_entity(test_fn)
94 def test_fn(x): function
99 node, source, _ = parser.parse_entity(test_fn)
/external/tensorflow/tensorflow/python/autograph/pyct/static_analysis/
Dliveness_test.py35 def _parse_and_analyze(self, test_fn): argument
36 node, source, _ = parser.parse_entity(test_fn)
70 def test_fn(x, a): function
77 node = self._parse_and_analyze(test_fn)
85 def test_fn(x, a): function
94 node = self._parse_and_analyze(test_fn)
102 def test_fn(x, a): function
107 node = self._parse_and_analyze(test_fn)
114 def test_fn(x, a): function
119 node = self._parse_and_analyze(test_fn)
[all …]
Dactivity_test.py114 def _parse_and_analyze(self, test_fn): argument
115 node, source, _ = parser.parse_entity(test_fn)
145 def test_fn(a): function
151 node, _ = self._parse_and_analyze(test_fn)
168 def test_fn(a): function
174 node, _ = self._parse_and_analyze(test_fn)
186 def test_fn(a): function
191 node, _ = self._parse_and_analyze(test_fn)
201 def test_fn(a): function
207 node, _ = self._parse_and_analyze(test_fn)
[all …]
Dreaching_definitions_test.py35 def _parse_and_analyze(self, test_fn): argument
36 node, source, _ = parser.parse_entity(test_fn)
82 def test_fn(a, b): function
88 node = self._parse_and_analyze(test_fn)
100 def test_fn(a): function
107 node = self._parse_and_analyze(test_fn)
120 def test_fn(x, i): function
130 node = self._parse_and_analyze(test_fn)
143 def test_fn(x, i): function
155 node = self._parse_and_analyze(test_fn)
[all …]
Dtype_info_test.py62 test_fn, argument
65 node, source, _ = parser.parse_entity(test_fn)
85 def test_fn(): function
89 node = self._parse_and_analyze(test_fn, {'training': training})
99 def test_fn(x): function
103 node = self._parse_and_analyze(test_fn, {})
109 def test_fn(): function
113 node = self._parse_and_analyze(test_fn, {'training': training})
120 def test_fn(x): function
124 node = self._parse_and_analyze(test_fn, {'session': session})
[all …]
Dlive_values_test.py39 test_fn, argument
44 node, source, _ = parser.parse_entity(test_fn)
66 def test_fn(): function
69 node = self._parse_and_analyze(test_fn, {}, literals={'a': 'bar'})
77 def test_fn(): function
80 node = self._parse_and_analyze(test_fn, {'a': True})
93 def test_fn(): function
96 node = self._parse_and_analyze(test_fn, {'foo': foo})
103 def test_fn(): function
106 node = self._parse_and_analyze(test_fn, {'constant_op': constant_op})
[all …]
/external/tensorflow/tensorflow/python/autograph/utils/
Dpy_func_test.py31 def test_fn(a, b, c): function
35 result = py_func.wrap_py_func(test_fn, dtypes.int32,
38 result = py_func.wrap_py_func(test_fn, dtypes.int32, (1, 1, 1))
41 test_fn, dtypes.int32,
52 def test_fn(a, b): function
56 result = py_func.wrap_py_func(test_fn, dtypes.int32, (7, TestClass()))
58 result = py_func.wrap_py_func(test_fn, dtypes.int32,
69 def test_fn(a, b, c, d): function
73 result = py_func.wrap_py_func(test_fn, dtypes.int32, (7, TestClass(5)), {
78 result = py_func.wrap_py_func(test_fn, dtypes.int32,
[all …]
/external/tensorflow/tensorflow/python/autograph/core/
Dconverter_test.py50 reparsed_opts = reparsed.test_fn()
66 def test_fn(): function
71 node, ctx = self.prepare(test_fn, ns)
87 def test_fn(): function
92 node, ctx = self.prepare(test_fn, ns)
103 def test_fn(): function
110 node, ctx = self.prepare(test_fn, ns)
130 def test_fn(): function
137 node, ctx = self.prepare(test_fn, ns)
/external/tensorflow/tensorflow/python/autograph/impl/
Dapi_test.py214 def test_fn(x): function
219 x = api.converted_call(test_fn, None, converter.ConversionOptions(),
226 def test_fn(x, y, z): function
232 functools.partial(test_fn, constant_op.constant(-1), z=-3), None,
238 functools.partial(test_fn, constant_op.constant(-1)), z=-3), None,
475 def test_fn(x, s): function
480 compiled_fn = api.to_graph(test_fn)
491 def test_fn(x, s=foo): function
496 compiled_fn = api.to_graph(test_fn)
504 def test_fn(x): function
[all …]

123