Fix tf.variable_scope unique name after entering root scope
authorMostafa Alaa <mostafa.alaa.gharieb@gmail.com>
Thu, 3 May 2018 02:53:18 +0000 (19:53 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Thu, 3 May 2018 02:56:05 +0000 (19:56 -0700)
Closes #18702.

PiperOrigin-RevId: 195192460

tensorflow/python/ops/variable_scope.py

index ba213ef..adb0f59 100644 (file)
@@ -1175,7 +1175,7 @@ class _VariableScopeStore(threading.local):
 
   def close_variable_subscopes(self, scope_name):
     for k in list(self.variable_scopes_count.keys()):
-      if not scope_name or k.startswith(scope_name + "/"):
+      if scope_name is None or k.startswith(scope_name + "/"):
         self.variable_scopes_count[k] = 0
 
   def variable_scope_count(self, scope_name):