parameters: (self, saving_listeners=None)
docstring: Calls `Estimator` train in a distributed setting.
docstring_summary: Calls `Estimator` train in a distributed setting.
docstring_tokens: Calls Estimator train in a distributed setting .
function: def _start_distributed_training(self, saving_listeners=None):
      """Calls `Estimator` train in a distributed setting."""
      config = self._estimator.config
  
      # Start in-process TensorFlow server if needed. It's important to start the
      # server before we (optionally) sleep. Otherwise, the servers will wait to
      # connect to each other before starting to train.
      if not _is_google_env():
        self._start_std_server(config)
  
      # Delay worker to start. For asynchronous training, this usually helps model
      # to converge faster.  Chief starts the training immediately, so, worker
      # with task id x (0-based) should wait (x+1) * _DELAY_SECS_PER_WORKER.
      start_delay_secs = 0
      if config.task_type == run_config_lib.TaskType.WORKER:
        # TODO(xiejw): Replace the hard code logic (task_id + 1) with unique id in
        # training cluster.
        start_delay_secs = min(_MAX_DELAY_SECS,
                               (config.task_id + 1) * _DELAY_SECS_PER_WORKER)
      if start_delay_secs > 0:
        logging.info('Waiting %d secs before starting training.',
                     start_delay_secs)
        time.sleep(start_delay_secs)
  
      self._estimator.train(input_fn=self._train_spec.input_fn,
                            max_steps=self._train_spec.max_steps,
                            hooks=self._train_spec.hooks,
                            saving_listeners=saving_listeners)
function_tokens: def _start_distributed_training ( self , saving_listeners = None ) : config = self . _estimator . config # Start in-process TensorFlow server if needed. It's important to start the # server before we (optionally) sleep. Otherwise, the servers will wait to # connect to each other before starting to train. if not _is_google_env ( ) : self . _start_std_server ( config ) # Delay worker to start. For asynchronous training, this usually helps model # to converge faster.  Chief starts the training immediately, so, worker # with task id x (0-based) should wait (x+1) * _DELAY_SECS_PER_WORKER. start_delay_secs = 0 if config . task_type == run_config_lib . TaskType . WORKER : # TODO(xiejw): Replace the hard code logic (task_id + 1) with unique id in # training cluster. start_delay_secs = min ( _MAX_DELAY_SECS , ( config . task_id + 1 ) * _DELAY_SECS_PER_WORKER ) if start_delay_secs > 0 : logging . info ( 'Waiting %d secs before starting training.' , start_delay_secs ) time . sleep ( start_delay_secs ) self . _estimator . train ( input_fn = self . _train_spec . input_fn , max_steps = self . _train_spec . max_steps , hooks = self . _train_spec . hooks , saving_listeners = saving_listeners )