docstr: Generate random bit tensor as arithmetic and binary shared tensors
docstr_tok: ["Generate","random","bit","tensor","as","arithmetic","and","binary","shared","tensors"]
code: def B2A_rng(self, size, device=None):
      """Generate random bit tensor as arithmetic and binary shared tensors"""
      generator = TTPClient.get().get_generator(device=device)
  
      # generate random bit
      rB = generate_kbit_random_tensor(
          size, bitlength=1, generator=generator, device=device
      )
  
      if comm.get().get_rank() == 0:
          # Request rA from TTP
          rA = TTPClient.get().ttp_request("B2A", device, size)
      else:
          rA = generate_random_ring_element(
              size, generator=generator, device=device
          )
  
      rA = ArithmeticSharedTensor.from_shares(rA, precision=0)
      rB = BinarySharedTensor.from_shares(rB)
      return rA, rB
  
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 5 for calling the TrustedThirdParty obj's underlying member method code with example usage: obj.B2A_rng(size, device) and returns: rA,  rB