class_docstr: An iterator over Train results. Returned by ``trainer.run_iterator``.
class_docstr_tok: ["An","iterator","over","Train","results",".","Returned","by","``","trainer.run_iterator","``","."]
code: def __init__(
      self,
      backend_executor: Union[BackendExecutor, ActorWrapper],
      backend_config: BackendConfig,
      train_func: Union[Callable[[], T], Callable[[Dict[str, Any]], T]],
      datasets: Dict[str, Dataset],
      metadata: Dict[str, Any],
      data_config: DataConfig,
      checkpoint: Optional[Union[Dict, str, Path, Checkpoint]],
  ):
      self._backend_executor = backend_executor
      self._backend = backend_config.backend_cls()
      self._train_func = train_func
      self._datasets = datasets
      self._metadata = metadata
      self._data_config = data_config
  
      self._start_training(
          train_func=train_func,
          datasets=self._datasets,
          metadata=self._metadata,
          data_config=self._data_config,
          checkpoint=checkpoint,
      )
  
      self._finished_training = False
  
imports: import logging
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Optional, TypeVar, Union
  from ray.air._internal.util import StartTraceback
  from ray.data import Dataset
  from ray.train import Checkpoint, DataConfig
  from ray.train._internal.backend_executor import BackendExecutor, InactiveWorkerGroupError, TrainBackendError, TrainingWorkerError
  from ray.train._internal.session import _TrainingResult, _TrainSession, get_session
  from ray.train._internal.utils import ActorWrapper
  from ray.train.backend import BackendConfig
  from ray.train.base_trainer import BaseTrainer, GenDataset, TrainingFailedError
  from ray.util.annotations import DeveloperAPI
label_desc: Use image node_id 1 to create a new TrainingIterator object  with example: obj = TrainingIterator(backend_executor, backend_config, train_func, datasets, metadata, data_config, checkpoint)