class_docstr: Base class for an RPC server using `torch.distributed`.
  Users should subclass this class and add the server methods.
  
  Example:
      init_method = "file://myfile.tmp"
      num_clients = 1
      torch.distributed.init_process_group('gloo',
                                           init_method=init_method,
                                           world_size=num_clients + 1,
                                           rank=0)
  
      class MyServer(Server):
          def test_func(self, T, k=0):
              return ("the result is ", T + k)
  
      s = MyServer(num_clients)
      s.start()  # will block until all clients have called `join()`
class_docstr_tok: ["Base","class","for","an","RPC","server","using","`","torch.distributed","`",".","Users","should","subclass","this","class","and","add","the","server","methods",".","Example",":","init_method","=","``","file",":","\/\/myfile.tmp","''","num_clients","=","1","torch.distributed.init_process_group","(","'gloo","'",",","init_method=init_method",",","world_size=num_clients","+","1",",","rank=0",")","class","MyServer","(","Server",")",":","def","test_func","(","self",",","T",",","k=0",")",":","return","(","``","the","result","is","``",",","T","+","k",")","s","=","MyServer","(","num_clients",")","s.start","(",")","#","will","block","until","all","clients","have","called","`","join","(",")","`"]
docstr: Args:
      num_clients: The number of clients that will call `join()` upon
                   completion.
docstr_tok: ["Args",":","num_clients",":","The","number","of","clients","that","will","call","`","join","(",")","`","upon","completion","."]
code: def __init__(self, num_clients):
      """
      Args:
          num_clients: The number of clients that will call `join()` upon
                       completion.
      """
      self.num_clients = num_clients
  
file_path: PyTorch-BigGraph/torchbiggraph/rpc.py
imports: import io
  import sys
  import traceback
  import numpy
  import torch
  import torch.distributed
label_desc: Use image node_id 1 to create a new Server object  with example: obj = Server(num_clients)