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.
()
| 5960 | |
| 5961 | |
| 5962 | def 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 | |
| 5982 | def _assert_same_graph(original_item, item): |
nothing calls this directly
no test coverage detected