提交 e65fbbc9 编写于 作者: A A. Unique TensorFlower 提交者: TensorFlower Gardener

Expose tf.contrib.framework.current_arg_scope()

PiperOrigin-RevId: 172922818
上级 54503483
......@@ -37,6 +37,7 @@ See the @{$python/contrib.framework} guide.
@@arg_scope
@@add_arg_scope
@@current_arg_scope
@@has_arg_scope
@@arg_scoped_arguments
......
......@@ -67,6 +67,7 @@ from tensorflow.python.util import tf_decorator
__all__ = ['arg_scope',
'add_arg_scope',
'current_arg_scope',
'has_arg_scope',
'arg_scoped_arguments']
......@@ -83,7 +84,7 @@ def _get_arg_stack():
return _ARGSTACK
def _current_arg_scope():
def current_arg_scope():
stack = _get_arg_stack()
return stack[-1]
......@@ -144,7 +145,7 @@ def arg_scope(list_ops_or_scope, **kwargs):
raise TypeError('list_ops_or_scope must either be a list/tuple or reused'
'scope (i.e. dict)')
try:
current_scope = _current_arg_scope().copy()
current_scope = current_arg_scope().copy()
for op in list_ops_or_scope:
key_op = _key_op(op)
if not has_arg_scope(op):
......@@ -172,7 +173,7 @@ def add_arg_scope(func):
A tuple with the decorated function func_with_args().
"""
def func_with_args(*args, **kwargs):
current_scope = _current_arg_scope()
current_scope = current_arg_scope()
current_args = kwargs
key_func = _key_op(func)
if key_func in current_scope:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册