docstr: Convert MPCTensor's underlying share to the corresponding ptype
  (ArithmeticSharedTensor, BinarySharedTensor)
  
  Args:
      ptype (Ptype.arithmetic or Ptype.binary): The ptype to convert
          the shares to.
      precision (int, optional): Precision of the fixed point encoder when
          converting a binary share to an arithmetic share. It will be ignored
          if the ptype doesn't match.
      bits (int, optional): If specified, will only preserve the bottom `bits` bits
          of a binary tensor when converting from a binary share to an arithmetic share.
          It will be ignored if the ptype doesn't match.
docstr_tok: ["Convert","MPCTensor","'s","underlying","share","to","the","corresponding","ptype","(","ArithmeticSharedTensor",",","BinarySharedTensor",")","Args",":","ptype","(","Ptype.arithmetic","or","Ptype.binary",")",":","The","ptype","to","convert","the","shares","to",".","precision","(","int",",","optional",")",":","Precision","of","the","fixed","point","encoder","when","converting","a","binary","share","to","an","arithmetic","share",".","It","will","be","ignored","if","the","ptype","does","n't","match",".","bits","(","int",",","optional",")",":","If","specified",",","will","only","preserve","the","bottom","`","bits","`","bits","of","a","binary","tensor","when","converting","from","a","binary","share","to","an","arithmetic","share",".","It","will","be","ignored","if","the","ptype","does","n't","match","."]
code: def _to_ptype(self, ptype, **kwargs):
      r"""
      Convert MPCTensor's underlying share to the corresponding ptype
      (ArithmeticSharedTensor, BinarySharedTensor)
  
      Args:
          ptype (Ptype.arithmetic or Ptype.binary): The ptype to convert
              the shares to.
          precision (int, optional): Precision of the fixed point encoder when
              converting a binary share to an arithmetic share. It will be ignored
              if the ptype doesn't match.
          bits (int, optional): If specified, will only preserve the bottom `bits` bits
              of a binary tensor when converting from a binary share to an arithmetic share.
              It will be ignored if the ptype doesn't match.
      """
      retval = self.clone()
      if retval.ptype == ptype:
          return retval
      retval._tensor = convert(self._tensor, ptype, **kwargs)
      retval.ptype = ptype
      return retval
  
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 8 for calling the MPCTensor obj's underlying member method code with example usage: obj._to_ptype(ptype) and returns: retval, retval