Fix a condition used for collective ops.

PiperOrigin-RevId: 355497796
Change-Id: I297c1841569d81742006fc5470a311fd2317fd10
This commit is contained in:
A. Unique TensorFlower 2021-02-03 15:38:10 -08:00 committed by TensorFlower Gardener
parent 4aa50ebfa8
commit c37243b055

View File

@ -355,8 +355,8 @@ class MirroredExtended(distribute_lib.StrategyExtendedV1):
self._initialize_single_worker(devices)
if self._prefer_collective_ops and (
isinstance(self._cross_device_ops, cross_device_ops_lib.NcclAllReduce)
or isinstance(self._inferred_cross_device_ops),
cross_device_ops_lib.NcclAllReduce):
or isinstance(self._inferred_cross_device_ops,
cross_device_ops_lib.NcclAllReduce)):
self._use_collective_ops(devices)
self._inferred_cross_device_ops = None
logging.info("Using MirroredStrategy with devices %r", devices)