aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/ops/variable_scope.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/ops/variable_scope.py')
-rw-r--r--tensorflow/python/ops/variable_scope.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tensorflow/python/ops/variable_scope.py b/tensorflow/python/ops/variable_scope.py
index c2193a24d0..7077f679ad 100644
--- a/tensorflow/python/ops/variable_scope.py
+++ b/tensorflow/python/ops/variable_scope.py
@@ -300,7 +300,8 @@ class _VariableStore(object):
initializer=None, regularizer=None, reuse=None,
trainable=True, collections=None, caching_device=None,
partitioner=None, validate_shape=True, use_resource=None):
- is_scalar = shape is not None and not shape
+ is_scalar = (shape is not None and isinstance(shape, collections_lib.Sequence)
+ and len(shape) == 0)
# Partitioned variable case
if partitioner is not None and not is_scalar:
if not callable(partitioner):