class_docstr: Record GPU information in each worker and respond to resource allocation of GPUs.
  
  Attributes:
      worker_vacant_gpus (dict): Record how many vacant gpus does each
                                 worker has.
      worker_used_gpus (dict): Record how many used gpus does each
                                 worker has.
class_docstr_tok: ["Record","GPU","information","in","each","worker","and","respond","to","resource","allocation","of","GPUs",".","Attributes",":","worker_vacant_gpus","(","dict",")",":","Record","how","many","vacant","gpus","does","each","worker","has",".","worker_used_gpus","(","dict",")",":","Record","how","many","used","gpus","does","each","worker","has","."]
docstr: "Return the number vacant of GPUs of all the workers.
docstr_tok: ["``","Return","the","number","vacant","of","GPUs","of","all","the","workers","."]
code: def gpu_num(self):
      """ "Return the number vacant of GPUs of all the workers."""
      return sum([len(gpu) for gpu in self.worker_vacant_gpus.values()])
  
file_path: PARL/parl/remote/gpu_resource.py
imports: from collections import defaultdict
  from parl.remote.message import AllocatedGpu
label_desc: Use image node_id 9 for calling the GpuResource obj's underlying member method code with example usage: obj.gpu_num() and returns: sum