MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / get_name_scope

Function get_name_scope

tensorflow/python/framework/ops.py:5962–5979  ·  view source on GitHub ↗

Returns the current name scope in the default_graph. For example: ```python with tf.name_scope('scope1'): with tf.name_scope('scope2'): print(tf.get_name_scope()) ``` would print the string `scope1/scope2`. Returns: A string representing the current name scope.

()

Source from the content-addressed store, hash-verified

5960
5961
5962def get_name_scope():
5963 """Returns the current name scope in the default_graph.
5964
5965 For example:
5966
5967 ```python
5968 with tf.name_scope('scope1'):
5969 with tf.name_scope('scope2'):
5970 print(tf.get_name_scope())
5971 ```
5972 would print the string `scope1/scope2`.
5973
5974 Returns:
5975 A string representing the current name scope.
5976 """
5977 if context.executing_eagerly():
5978 return context.context().scope_name.rstrip("/")
5979 return get_default_graph().get_name_scope()
5980
5981
5982def _assert_same_graph(original_item, item):

Callers

nothing calls this directly

Calls 4

get_default_graphFunction · 0.85
executing_eagerlyMethod · 0.80
get_name_scopeMethod · 0.80
contextMethod · 0.45

Tested by

no test coverage detected