class_docstr: HACK(geoffrey): This is a temporary fix to support Ray 2.1.0.
  
  Specifically, this Tuner ensures that TunerInternalRay210 is called by the class.
  For more details, see TunerInternalRay210.
class_docstr_tok: ["HACK","(","geoffrey",")",":","This","is","a","temporary","fix","to","support","Ray","2.1.0",".","Specifically",",","this","Tuner","ensures","that","TunerInternalRay210","is","called","by","the","class",".","For","more","details",",","see","TunerInternalRay210","."]
docstr: Configure and construct a tune run.
docstr_tok: ["Configure","and","construct","a","tune","run","."]
code: def __init__(
      self,
      trainable: Optional[
          Union[
              str,
              Callable,
              Type[Trainable],
              "BaseTrainer",
          ]
      ] = None,
      *,
      param_space: Optional[Dict[str, Any]] = None,
      tune_config: Optional[TuneConfig] = None,
      run_config: Optional[RunConfig] = None,
      # This is internal only arg.
      # Only for dogfooding purposes. We can slowly promote these args
      # to RunConfig or TuneConfig as needed.
      # TODO(xwjiang): Remove this later.
      _tuner_kwargs: Optional[Dict] = None,
      _tuner_internal: Optional[TunerInternal] = None,
  ):
      """Configure and construct a tune run."""
      kwargs = locals().copy()
      self._is_ray_client = ray.util.client.ray.is_connected()
      if _tuner_internal:
          if not self._is_ray_client:
              self._local_tuner = kwargs[_TUNER_INTERNAL]
          else:
              self._remote_tuner = kwargs[_TUNER_INTERNAL]
      else:
          kwargs.pop(_TUNER_INTERNAL, None)
          kwargs.pop(_SELF, None)
          if not self._is_ray_client:
              self._local_tuner = TunerInternalRay210(**kwargs)
          else:
              self._remote_tuner = _force_on_current_node(
                  ray.remote(num_cpus=0)(TunerInternalRay210)
              ).remote(**kwargs)
  
file_path: ludwig/ludwig/backend/_ray210_compat.py
imports: import math
  from typing import Any, Callable, Dict, Optional, Type, TYPE_CHECKING, Union
  import ray
  from ray.air.config import RunConfig
  from ray.tune.execution.trial_runner import _ResumeConfig
  from ray.tune.impl.tuner_internal import TunerInternal
  from ray.tune.trainable import Trainable
  from ray.tune.tune_config import TuneConfig
  from ray.tune.tuner import _SELF, _TUNER_INTERNAL, Tuner
  from ray.tune.utils.node import _force_on_current_node
label_desc: Use image node_id 1 to create a new TunerRay210 object from inherited base classes: Tuner with example: obj = TunerRay210(trainable)