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 num_workers(self) -> int:
      return int(self.num_hosts * self.num_workers_per_host)
  
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 2 for calling the ColocatedStrategy obj's underlying member method code with example usage: obj.num_workers() and returns: int