Updates the eager context to enter the given name scope.
(ctx, name)
| 6452 | |
| 6453 | |
| 6454 | def enter_eager_name_scope(ctx, name): |
| 6455 | """Updates the eager context to enter the given name scope.""" |
| 6456 | old_name = ctx.scope_name |
| 6457 | if not name: |
| 6458 | scope_name = "" |
| 6459 | else: |
| 6460 | if name.endswith("/"): |
| 6461 | # A trailing slash breaks out of nested name scopes, indicating a |
| 6462 | # fully specified scope name, for compatibility with Graph.name_scope. |
| 6463 | scope_name = name |
| 6464 | else: |
| 6465 | scope_name = name + "/" |
| 6466 | if old_name: |
| 6467 | scope_name = old_name + scope_name |
| 6468 | ctx.scope_name = scope_name |
| 6469 | return scope_name, old_name |
| 6470 | |
| 6471 | |
| 6472 | @tf_export("name_scope", v1=[]) |