docstr: Returns a tensor with elements uniformly sampled in [0, 1). The uniform
  random samples are generated by generating random bits using fixed-point
  encoding and converting the result to an ArithmeticSharedTensor.
docstr_tok: ["Returns","a","tensor","with","elements","uniformly","sampled","in","[","0",",","1",")",".","The","uniform","random","samples","are","generated","by","generating","random","bits","using","fixed-point","encoding","and","converting","the","result","to","an","ArithmeticSharedTensor","."]
code: def rand(*sizes, device=None):
      """
      Returns a tensor with elements uniformly sampled in [0, 1). The uniform
      random samples are generated by generating random bits using fixed-point
      encoding and converting the result to an ArithmeticSharedTensor.
      """
      rand = MPCTensor([])
      encoder = FixedPointEncoder()
      rand._tensor = BinarySharedTensor.rand(
          *sizes, bits=encoder._precision_bits, device=device
      )
      rand._tensor.encoder = encoder
      rand.ptype = Ptype.binary
      return rand.to(Ptype.arithmetic, bits=encoder._precision_bits)
  
imports: import torch
  from .None import communicator
  from .common.tensor_types import is_tensor
  from .common.util import torch_stack
  from .config import cfg
  from .cryptensor import CrypTensor
  from .cuda import CUDALongTensor
  from .encoder import FixedPointEncoder
  from .primitives.binary import BinarySharedTensor
  from .primitives.converters import convert
  from .ptype import ptype
label_desc: Use image node_id 21 for calling the MPCTensor obj's underlying member method code with example usage: obj.rand() and returns: rand