From 9e2c9f35271a2416ec59cd6fa5ef9b5ee690c95d Mon Sep 17 00:00:00 2001 From: Priya Gupta Date: Thu, 24 May 2018 15:35:13 -0700 Subject: [PATCH] Avoid infinite recursion when checking for indexed slices. PiperOrigin-RevId: 197965508 --- tensorflow/contrib/distribute/python/cross_tower_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/contrib/distribute/python/cross_tower_utils.py b/tensorflow/contrib/distribute/python/cross_tower_utils.py index 4bff134..137fabf 100644 --- a/tensorflow/contrib/distribute/python/cross_tower_utils.py +++ b/tensorflow/contrib/distribute/python/cross_tower_utils.py @@ -374,7 +374,7 @@ def contains_indexed_slices(value): """Check whether the value is `IndexedSlices` or contains `IndexedSlices`.""" if isinstance(value, ops.IndexedSlices): return True - elif isinstance(value, (list, tuple, pycoll.Sequence)) and value: + elif isinstance(value, (list, tuple)) and value: return any(contains_indexed_slices(v) for v in value) elif isinstance(value, value_lib.DistributedValues): return contains_indexed_slices(list(value._index.values())) # pylint: disable=protected-access -- 2.7.4