aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/contrib/framework
diff options
context:
space:
mode:
authorGravatar accraze <accraze@gmail.com>2018-04-15 16:28:12 -0700
committerGravatar accraze <accraze@gmail.com>2018-05-05 08:58:26 -0700
commitdea558b2f9dd27ae974a691a5d99fd96030dafb5 (patch)
tree410da3d5bb3bd58e3a6e5b8a7c47fb4a6e186ee9 /tensorflow/contrib/framework
parent6c62fa93ad22594c65e1b3f7aecce79da660f5e9 (diff)
adding arg scope test
Diffstat (limited to 'tensorflow/contrib/framework')
-rw-r--r--tensorflow/contrib/framework/python/ops/arg_scope_test.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tensorflow/contrib/framework/python/ops/arg_scope_test.py b/tensorflow/contrib/framework/python/ops/arg_scope_test.py
index 4c3879d4fc..c58ff603f8 100644
--- a/tensorflow/contrib/framework/python/ops/arg_scope_test.py
+++ b/tensorflow/contrib/framework/python/ops/arg_scope_test.py
@@ -38,6 +38,12 @@ def func3(args, a=None, b=1, c=2):
"""Some cool doc string."""
return (args, a, b, c)
+@add_arg_scope
+def func4(x='x', y='y'):
+ if x:
+ pass
+ if y:
+ pass
def _key_op(op):
return getattr(op, '_key_op', str(op))
@@ -231,6 +237,15 @@ class ArgScopeTest(test.TestCase):
self.assertTupleEqual(args, func2_args)
self.assertDictEqual(kwargs, func2_kwargs)
+ def testAddArgScopeRaceCondition(self):
+ func4_kwargs = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h')
+ for i in range(4):
+ # redefine the function with different args
+ @add_arg_scope
+ def func4(a=1, b=2, c=3, d=4, e=5, f=6, g=7, h=8):
+ pass
+ self.assertTupleEqual(arg_scoped_arguments(func4), func4_kwargs)
+
def testDocString(self):
self.assertEqual(func3.__doc__, 'Some cool doc string.')