refine by using iterator of partitioned variable
authorwangsiyu <siyu.wsy@gmail.com>
Fri, 4 May 2018 02:52:26 +0000 (10:52 +0800)
committerwangsiyu <siyu.wsy@gmail.com>
Fri, 4 May 2018 02:52:26 +0000 (10:52 +0800)
tensorflow/python/layers/base.py

index c050e6b..f7b2e47 100644 (file)
@@ -358,7 +358,7 @@ def _add_elements_to_collection(elements, collection_list):
 def _should_add_regularizer(variable, existing_variable_set):
   result = True
   if isinstance(variable, tf_variables.PartitionedVariable):
-    for var in variable._get_variable_list():
+    for var in variable:
       if var in existing_variable_set:
         result = False
         break