message: Remove caching in enter_eager_name_scope
  It does not seem to have any effect
  # Before
  >>> ctx.scope_name = "Module/NestedModule/Memory/Layer/"
  >>> %%timeit
  name_scope_cache.clear()
  enter_eager_name_scope(ctx, "foobar")
  loops, best of 3: 1.59 ?s per loop
  # After
  >>> %%timeit
  name_scope_cache.clear()
  enter_eager_name_scope(ctx, "foobar")
  loops, best of 3: 1.29 ?s per loop
diff: @@ -6153,9 +6153,6 @@ def get_all_collection_keys():
  return get_default_graph().get_all_collection_keys()
  -name_scope_cache = {}
  -
  -
  # Named like a function for backwards compatibility with the
  # @tf_contextlib.contextmanager version, which was switched to a class to avoid
  # some object creation overhead.
  @@ -6228,9 +6225,7 @@ class name_scope(object): # pylint: disable=invalid-name
  return self._name_scope.__enter__()
  if self._in_eager_mode:
  - scope_name, old_name = enter_eager_name_scope(self._ctx, self._name,
  - self._default_name)
  - self._old_name = old_name
  + scope_name, self._old_name = enter_eager_name_scope(self._ctx, self._name)
  return scope_name
  else:
  if self._name is None and self._values is not None:
  @@ -6269,25 +6264,20 @@ class name_scope(object): # pylint: disable=invalid-name
  return False # False values do not suppress exceptions
  -def enter_eager_name_scope(ctx, name, default_name=None):
  +def enter_eager_name_scope(ctx, name):
  """Updates the eager context to enter the given name scope."""
  old_name = ctx.scope_name
  if not name:
  scope_name = ""
  else:
  - if name[-1] == "/":
  + if name.endswith("/"):
  # A trailing slash breaks out of nested name scopes, indicating a
  # fully specified scope name, for compatibility with Graph.name_scope.
  scope_name = name
  else:
  - # TODO(tomhennigan) Benchmark and consider removing the cache.
  - cache_key = name, old_name, default_name
  - scope_name = name_scope_cache.get(cache_key, None)
  - if scope_name is None:
  scope_name = name + "/"
  if old_name:
  scope_name = old_name + scope_name
  - name_scope_cache[cache_key] = scope_name
  ctx.scope_name = scope_name
  return scope_name, old_name
  