class_docstr: Ensures that the workers are balanced across all hosts.
class_docstr_tok: ["Ensures","that","the","workers","are","balanced","across","all","hosts","."]
code: def _resources_per_host(self):
      num_cpus = self.cpus_per_worker * self.num_workers_per_host
      num_gpus = (
          self.gpus_per_worker
          * self.num_workers_per_host
          * int(self.use_gpu)
      )
      return dict(CPU=num_cpus, GPU=num_gpus)
  
imports: from collections import defaultdict
  import logging
  from typing import Dict
  import ray
  from ray.util.placement_group import get_current_placement_group
  from horovod.ray.utils import map_blocking
  from horovod.ray.worker import BaseHorovodWorker
label_desc: Use image node_id 3 for calling the ColocatedStrategy obj's underlying member method code with example usage: obj._resources_per_host() and returns: dict