docstr: Depending on the input arguments,
  converts underlying share to the given ptype or
  performs `torch.to` on the underlying torch tensor
  
  To convert underlying share to the given ptype, call `to` as:
      to(ptype, **kwargs)
  
  It will call MPCTensor.to_ptype with the arguments provided above.
  
  Otherwise, `to` performs `torch.to` on the underlying
  torch tensor. See
  https://pytorch.org/docs/stable/tensors.html?highlight=#torch.Tensor.to
  for a reference of the parameters that can be passed in.
  
  Args:
      ptype: Ptype.arithmetic or Ptype.binary.
docstr_tok: ["Depending","on","the","input","arguments",",","converts","underlying","share","to","the","given","ptype","or","performs","`","torch.to","`","on","the","underlying","torch","tensor","To","convert","underlying","share","to","the","given","ptype",",","call","`","to","`","as",":","to","(","ptype",",","*","*","kwargs",")","It","will","call","MPCTensor.to_ptype","with","the","arguments","provided","above",".","Otherwise",",","`","to","`","performs","`","torch.to","`","on","the","underlying","torch","tensor",".","See","https",":","\/\/pytorch.org\/docs\/stable\/tensors.html","?","highlight=","#","torch.Tensor.to","for","a","reference","of","the","parameters","that","can","be","passed","in",".","Args",":","ptype",":","Ptype.arithmetic","or","Ptype.binary","."]
code: def to(self, *args, **kwargs):
      r"""
      Depending on the input arguments,
      converts underlying share to the given ptype or
      performs `torch.to` on the underlying torch tensor
  
      To convert underlying share to the given ptype, call `to` as:
          to(ptype, **kwargs)
  
      It will call MPCTensor.to_ptype with the arguments provided above.
  
      Otherwise, `to` performs `torch.to` on the underlying
      torch tensor. See
      https://pytorch.org/docs/stable/tensors.html?highlight=#torch.Tensor.to
      for a reference of the parameters that can be passed in.
  
      Args:
          ptype: Ptype.arithmetic or Ptype.binary.
      """
      if "ptype" in kwargs:
          return self._to_ptype(**kwargs)
      elif args and isinstance(args[0], Ptype):
          ptype = args[0]
          return self._to_ptype(ptype, **kwargs)
      else:
          share = self.share.to(*args, **kwargs)
          if share.is_cuda:
              share = CUDALongTensor(share)
          self.share = share
          return self
  
imports: import torch
  from crypten import communicator
  from crypten.common.tensor_types import is_tensor
  from crypten.common.util import torch_stack
  from crypten.config import cfg
  from crypten.cuda import CUDALongTensor
  from ..cryptensor import CrypTensor
  from ..encoder import FixedPointEncoder
  from .primitives.binary import BinarySharedTensor
  from .primitives.converters import convert
  from .ptype import ptype
label_desc: Use image node_id 7 for calling the MPCTensor obj's underlying member method code with example usage: obj.to() and returns: self, self, self