class_docstr: HACK(geoffrey): This is a temporary fix to support Ray 2.1.0.
  
  This TunerInternal ensures that a division by zero is avoided when running zero-CPU hyperopt trials.
  This is fixed in ray>=2.2 (but not ray<=2.1) here: https://github.com/ray-project/ray/pull/30598
class_docstr_tok: ["HACK","(","geoffrey",")",":","This","is","a","temporary","fix","to","support","Ray","2.1.0",".","This","TunerInternal","ensures","that","a","division","by","zero","is","avoided","when","running","zero-CPU","hyperopt","trials",".","This","is","fixed","in","ray",">","=2.2","(","but","not","ray","<","=2.1",")","here",":","https",":","\/\/github.com\/ray-project\/ray\/pull\/30598"]
code: def _expected_utilization(self, cpus_per_trial, cpus_total):
      num_samples = self._tune_config.num_samples
      if num_samples < 0:  # TODO: simplify this in Tune
          num_samples = math.inf
      concurrent_trials = self._tune_config.max_concurrent_trials or 0
      if concurrent_trials < 1:  # TODO: simplify this in Tune
          concurrent_trials = math.inf
  
      actual_concurrency = min(
          (
              (cpus_total // cpus_per_trial) if cpus_per_trial else 0,
              num_samples,
              concurrent_trials,
          )
      )
      return (actual_concurrency * cpus_per_trial) / (
          cpus_total + 0.001
      )
  
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 for calling the TunerInternalRay210 obj's underlying member method code with example usage: obj._expected_utilization(cpus_per_trial, cpus_total) and returns: unknown