From 0c464c70cef2369b6ef5c5e17dbd2cda2a6107fb Mon Sep 17 00:00:00 2001 From: Tom Hennigan Date: Sun, 14 Apr 2019 23:46:36 -0700 Subject: [PATCH] Minor readability change to use `all` rather than a loop. PiperOrigin-RevId: 243560270 --- tensorflow/python/distribute/values.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tensorflow/python/distribute/values.py b/tensorflow/python/distribute/values.py index 4c64041d2db..ecd29197b7b 100644 --- a/tensorflow/python/distribute/values.py +++ b/tensorflow/python/distribute/values.py @@ -282,10 +282,7 @@ class DistributedValues(object): @property def is_tensor_like(self): - for v in self._values: - if not tensor_util.is_tensor(v): - return False - return True + return all(tensor_util.is_tensor(v) for v in self._values) def __str__(self): devices = self.devices