class_docstr: Packs workers together but does not guarantee balanced hosts.
  
  Will use the current placement group if one is available.
class_docstr_tok: ["Packs","workers","together","but","does","not","guarantee","balanced","hosts",".","Will","use","the","current","placement","group","if","one","is","available","."]
code: def resources_per_worker(self):
      num_cpus = self.cpus_per_worker
      num_gpus = self.gpus_per_worker * 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 PGStrategy obj's underlying member method code with example usage: obj.resources_per_worker() and returns: dict