docstr: Coordinator object to run on worker.  Only one coordinator exists.  Responsible
  for facilitating communication between agent and observers and recording benchmark
  throughput and latency data.
  Args:
      batch_size (int): Number of observer requests to process in a batch
      batch (bool): Whether to process and respond to observer requests as a batch or 1 at a time
      state_size (list): List of ints dictating the dimensions of the state
      nlayers (int): Number of layers in the model
      out_features (int): Number of out features in the model
docstr_tok: ["Coordinator","object","to","run","on","worker",".","Only","one","coordinator","exists",".","Responsible","for","facilitating","communication","between","agent","and","observers","and","recording","benchmark","throughput","and","latency","data",".","Args",":","batch_size","(","int",")",":","Number","of","observer","requests","to","process","in","a","batch","batch","(","bool",")",":","Whether","to","process","and","respond","to","observer","requests","as","a","batch","or","1","at","a","time","state_size","(","list",")",":","List","of","ints","dictating","the","dimensions","of","the","state","nlayers","(","int",")",":","Number","of","layers","in","the","model","out_features","(","int",")",":","Number","of","out","features","in","the","model"]
code: def __init__(
      self, batch_size, batch, state_size, nlayers, out_features
  ):
      r"""
      Coordinator object to run on worker.  Only one coordinator exists.  Responsible
      for facilitating communication between agent and observers and recording benchmark
      throughput and latency data.
      Args:
          batch_size (int): Number of observer requests to process in a batch
          batch (bool): Whether to process and respond to observer requests as a batch or 1 at a time
          state_size (list): List of ints dictating the dimensions of the state
          nlayers (int): Number of layers in the model
          out_features (int): Number of out features in the model
      """
      self.batch_size = batch_size
      self.batch = batch
  
      self.agent_rref = None  # Agent RRef
      self.ob_rrefs = []  # Observer RRef
  
      agent_info = rpc.get_worker_info(AGENT_NAME)
      self.agent_rref = rpc.remote(agent_info, AgentBase)
  
      for rank in range(batch_size):
          ob_info = rpc.get_worker_info(OBSERVER_NAME.format(rank + 2))
          ob_ref = rpc.remote(ob_info, ObserverBase)
          self.ob_rrefs.append(ob_ref)
  
          ob_ref.rpc_sync().set_state(state_size, batch)
  
      self.agent_rref.rpc_sync().set_world(
          batch_size, state_size, nlayers, out_features, self.batch
      )
  
file_path: pytorch/benchmarks/distributed/rpc/rl/coordinator.py
imports: import time
  import numpy
  import torch
  import torch.distributed.rpc
  from agent import AgentBase
  from observer import ObserverBase
label_desc: Use image node_id 1 to create a new CoordinatorBase object  with example: obj = CoordinatorBase(batch_size, batch, state_size, nlayers, out_features)