code: def convert(tensor, ptype, **kwargs):
      tensor_name = ptype.to_tensor()
      if isinstance(tensor, tensor_name):
          return tensor
      if (
          isinstance(tensor, ArithmeticSharedTensor)
          and ptype == Ptype.binary
      ):
          return _A2B(tensor)
      elif (
          isinstance(tensor, BinarySharedTensor)
          and ptype == Ptype.arithmetic
      ):
          return _B2A(tensor, **kwargs)
      else:
          raise TypeError(
              "Cannot convert %s to %s" % (type(tensor), ptype.__name__)
          )
  
file_path: CrypTen/crypten/mpc/primitives/converters.py
imports: import crypten.communicator
  import torch
  from crypten.encoder import FixedPointEncoder
  from ..ptype import ptype
  from .None import beaver
  from .arithmetic import ArithmeticSharedTensor
  from .binary import BinarySharedTensor
label_desc: Use image node_id 3 for calling a global function with example usage: convert(tensor, ptype) and returns: tensor, _A2B, _B2A