class_docstr: A simple parameter server. Clients can store tensors, accumulate, and
  get tensors by string key. Operations on the parameter server are globally
  synchronous.
  
  FIXME: torchbiggraph.rpc should be fixed to not require torch.serialization,
  then most of this code can be removed.
  FIXME: torch.distributed.recv should not require you to provide the
  tensor to write to; the type and size should be sent in the header.
  That would simplify this code a lot.
class_docstr_tok: ["A","simple","parameter","server",".","Clients","can","store","tensors",",","accumulate",",","and","get","tensors","by","string","key",".","Operations","on","the","parameter","server","are","globally","synchronous",".","FIXME",":","torchbiggraph.rpc","should","be","fixed","to","not","require","torch.serialization",",","then","most","of","this","code","can","be","removed",".","FIXME",":","torch.distributed.recv","should","not","require","you","to","provide","the","tensor","to","write","to",";","the","type","and","size","should","be","sent","in","the","header",".","That","would","simplify","this","code","a","lot","."]
code: def __init__(
      self,
      num_clients: int,
      group_idxs: Optional[Sequence[int]] = None,
      log_stats: bool = False,
  ) -> None:
      self.num_clients = num_clients
      self.parameters: Dict[str, torch.Tensor] = {}
      self.group_idxs = group_idxs
      self.groups: Optional[List["td.ProcessGroup"]] = None
      self.log_stats = log_stats
  
imports: import logging
  import multiprocessing
  import queue
  import time
  import traceback
  from functools import lru_cache
  from typing import Callable, Dict, List, Optional, Sequence
  import torch
  import torch.distributed
  import torch.multiprocessing
  from torchbiggraph.distributed import init_process_group, Startable
  from torchbiggraph.types import CharTensorType, Rank
  from torchbiggraph.util import allocate_shared_tensor, split_almost_equally, tag_logs_with_process_name
label_desc: Use image node_id 1 to create a new ParameterServer object from inherited base classes: Startable with example: obj = ParameterServer(num_clients, group_idxs, log_stats)