docstr: Create random generator to send to a party
docstr_tok: ["Create","random","generator","to","send","to","a","party"]
code: def _setup_generators(self):
      """Create random generator to send to a party"""
      ws = comm.get().get_world_size()
  
      seeds = [
          torch.randint(-(2**63), 2**63 - 1, size=())
          for _ in range(ws)
      ]
      reqs = [
          dist.isend(tensor=seeds[i], dst=i, group=self.ttp_group)
          for i in range(ws)
      ]
      self.generators = [
          torch.Generator(device="cpu") for _ in range(ws)
      ]
      self.generators_cuda = [
          (
              torch.Generator(device="cuda")
              if torch.cuda.is_available()
              else None
          )
          for _ in range(ws)
      ]
  
      for i in range(ws):
          self.generators[i].manual_seed(seeds[i].item())
          if torch.cuda.is_available():
              self.generators_cuda[i].manual_seed(seeds[i].item())
          reqs[i].wait()
  
      dist.barrier(group=self.ttp_group)
  
imports: import logging
  import crypten
  import crypten.communicator
  import torch
  import torch.distributed
  from crypten.common.rng import generate_kbit_random_tensor, generate_random_ring_element
  from crypten.common.util import count_wraps
  from crypten.mpc.primitives import ArithmeticSharedTensor, BinarySharedTensor
  from .provider import TupleProvider
label_desc: Use image node_id 2 for calling the TTPServer obj's underlying member method code with example usage: obj._setup_generators() without return types