|
25 | 25 | from tfx_bsl.types import tfx_namedtuple |
26 | 26 |
|
27 | 27 | # pylint: disable=g-direct-tensorflow-import |
28 | | -from tensorflow.python.framework import function |
29 | 28 | from tensorflow.python.ops import control_flow_ops |
30 | | -from tensorflow.python.ops import functional_ops |
31 | 29 | # pylint: disable=g-enable-tensorflow-import |
32 | 30 | mock = tf.compat.v1.test.mock |
33 | 31 |
|
@@ -60,22 +58,6 @@ def foo(x, y): |
60 | 58 | return {'x': x, 'y': y, 'z': a + b + c, 'r': a, 'q': foo(x, x)[0]} |
61 | 59 |
|
62 | 60 |
|
63 | | -def _create_graph_with_tf_defun(): |
64 | | - x = tf.compat.v1.placeholder(tf.int64) |
65 | | - y = tf.compat.v1.placeholder(tf.int64) |
66 | | - |
67 | | - @tf.function |
68 | | - def identity(x): |
69 | | - return x |
70 | | - |
71 | | - @function.Defun(tf.int64, tf.int64) |
72 | | - def foo(x, y): |
73 | | - return identity(x * 2), identity(x + y), identity(y * 2) |
74 | | - |
75 | | - a, b, c = functional_ops.partitioned_call([x, y], foo) |
76 | | - return {'x': x, 'y': y, 'z': a + b + c, 'r': a, 'q': foo(x, x)[0]} |
77 | | - |
78 | | - |
79 | 61 | def _create_graph_with_tf2_saved_model_with_table(): |
80 | 62 |
|
81 | 63 | def export_saved_model_v2(): |
@@ -674,12 +656,6 @@ def testInitializableGraphAnalyzerReadyToRunRaises( |
674 | 656 | feeds=['x', 'y'], |
675 | 657 | fetches=['z'], |
676 | 658 | expected_dependent_inputs=['x', 'y']), |
677 | | - dict( |
678 | | - testcase_name='_tf_defun', |
679 | | - create_graph_fn=_create_graph_with_tf_defun, |
680 | | - feeds=['x', 'y'], |
681 | | - fetches=['z'], |
682 | | - expected_dependent_inputs=['x', 'y']), |
683 | 659 | dict( |
684 | 660 | testcase_name='_tf_function_signature_forces_dependencies', |
685 | 661 | create_graph_fn=_create_graph_with_tf_function, |
|
0 commit comments