Minor readability change to use all
rather than a loop.
PiperOrigin-RevId: 243560270
This commit is contained in:
parent
9b0656f8ac
commit
0c464c70ce
@ -282,10 +282,7 @@ class DistributedValues(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def is_tensor_like(self):
|
def is_tensor_like(self):
|
||||||
for v in self._values:
|
return all(tensor_util.is_tensor(v) for v in self._values)
|
||||||
if not tensor_util.is_tensor(v):
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
devices = self.devices
|
devices = self.devices
|
||||||
|
Loading…
Reference in New Issue
Block a user