message: Refactor common code in MirroredExtended.
diff: @@ -385,6 +385,10 @@ class MirroredExtended(distribute_lib.StrategyExtendedV1):
  def _initialize_strategy(self, devices):
  # The _initialize_strategy method is intended to be used by distribute
  # coordinator as well.
  + assert devices, "Must specify at least one device."
  + devices = tuple(device_util.resolve(d) for d in devices)
  + assert len(set(devices)) == len(devices), (
  + "No duplicates allowed in `devices` argument: %s" % (devices,))
  if _is_device_list_local(devices):
  self._initialize_local(devices)
  else:
  @@ -393,11 +397,6 @@ class MirroredExtended(distribute_lib.StrategyExtendedV1):
  def _initialize_local(self, devices):
  """Initializes the object for local training."""
  self._local_mode = True
  - assert devices, "Must specify at least one device."
  - devices = tuple(device_util.resolve(d) for d in devices)
  - assert len(set(devices)) == len(devices), (
  - "No duplicates allowed in `devices` argument: %s" % (devices,))
  - # TODO(josh11b): Require at least 2 devices?
  self._device_map = values.ReplicaDeviceMap(devices)
  self._input_workers = input_lib.InputWorkers(self._device_map)
  self._inferred_cross_device_ops = cross_device_ops_lib.choose_the_best(
  @@ -407,13 +406,6 @@ class MirroredExtended(distribute_lib.StrategyExtendedV1):
  def _initialize_multi_worker(self, devices):
  """Initializes the object for multi-worker training."""
  self._local_mode = False
  -
  - assert devices, "Must specify at least one device."
  - devices = tuple(device_util.resolve(d) for d in devices)
  - assert len(set(devices)) == len(devices), (
  - "No duplicates allowed in `devices` argument: %s" % devices)
  - # TODO(josh11b): Require at least 2 devices?
  -
  device_dict = _group_device_list(devices)
  workers = []
  worker_devices = []
  