aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gunhan Gulsoy <gunan@google.com>2018-10-09 13:31:58 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-09 13:36:14 -0700
commit9989788be25c846d087ac70b76cf78759a209a3e (patch)
tree892e1ef29d424a21cb2a904adf92e3e8b5f427f3
parent1e13c38980ec17d9f26c041f4b251ecb3a791a2c (diff)
Small cleanup in function_test.
PiperOrigin-RevId: 216412380
-rw-r--r--tensorflow/python/framework/function_test.py27
1 files changed, 8 insertions, 19 deletions
diff --git a/tensorflow/python/framework/function_test.py b/tensorflow/python/framework/function_test.py
index 87f567db0e..16d4903d79 100644
--- a/tensorflow/python/framework/function_test.py
+++ b/tensorflow/python/framework/function_test.py
@@ -1639,29 +1639,18 @@ class FunctionInlineControlTest(test.TestCase):
self.assertEqual(MetadataHasCell(run_metadata), noinline)
-@function.Defun(*[dtypes.float32] * 3)
-def Linear(w, b, x):
- return nn_ops.relu(math_ops.matmul(x, w) + b)
-
-
-@function.Defun(*[dtypes.float32] * 5)
-def Linear2(w1, b1, w2, b2, x):
- return Linear(w2, b2, Linear(w1, b1, x))
-
-
-@function.Defun(*[dtypes.float32] * 3)
-def LinearWithCApi(w, b, x):
- return nn_ops.relu(math_ops.matmul(x, w) + b)
-
+class ModuleFunctionTest(test.TestCase):
-@function.Defun(*[dtypes.float32] * 5)
-def Linear2WithCApi(w1, b1, w2, b2, x):
- return LinearWithCApi(w2, b2, LinearWithCApi(w1, b1, x))
+ def testBasic(self):
+ @function.Defun(*[dtypes.float32] * 3)
+ def LinearWithCApi(w, b, x):
+ return nn_ops.relu(math_ops.matmul(x, w) + b)
-class ModuleFunctionTest(test.TestCase):
+ @function.Defun(*[dtypes.float32] * 5)
+ def Linear2WithCApi(w1, b1, w2, b2, x):
+ return LinearWithCApi(w2, b2, LinearWithCApi(w1, b1, x))
- def testBasic(self):
with ops.Graph().as_default():
a, b, c, d, e = [
constant_op.constant([[_]], dtype=dtypes.float32) for _ in range(5)