code: def argumenttype_type(
      t: Type,
      *,
      mutable: bool,
      binds: ArgName,
      remove_non_owning_ref_types: bool = False,
      symint: bool = False,
  ) -> NamedCType:
      # If it's a value type, do the value type translation
      r = valuetype_type(
          t,
          binds=binds,
          symint=symint,
          remove_non_owning_ref_types=remove_non_owning_ref_types,
      )
      if r is not None:
          return r
  
      if isinstance(t, BaseType):
          if t.name == BaseTy.Tensor:
              if (
                  mutable
                  and not local.use_const_ref_for_mutable_tensors()
              ):
                  return NamedCType(
                      binds, MutRefCType(BaseCType(tensorT))
                  )
              else:
                  return NamedCType(
                      binds, ConstRefCType(BaseCType(tensorT))
                  )
          elif t.name == BaseTy.Scalar:
              return NamedCType(
                  binds, ConstRefCType(BaseCType(scalarT))
              )
          else:
              raise AssertionError(
                  f"base type should have been value type {t}"
              )
      elif isinstance(t, OptionalType):
          if str(t.elem) == "Tensor":
              if (
                  mutable
                  and not local.use_const_ref_for_mutable_tensors()
              ):
                  return NamedCType(
                      binds, MutRefCType(BaseCType(tensorT))
                  )  # TODO: fix this discrepancy
              else:
                  return NamedCType(
                      binds,
                      ConstRefCType(OptionalCType(BaseCType(tensorT))),
                  )
          elif str(t.elem) == "Scalar":
              return NamedCType(
                  binds,
                  ConstRefCType(OptionalCType(BaseCType(scalarT))),
              )
          elif (
              isinstance(t.elem, ListType) and str(t.elem.elem) == "int"
          ):
              return NamedCType(binds, BaseCType(optionalIntArrayRefT))
          elif (
              isinstance(t.elem, ListType)
              and str(t.elem.elem) == "SymInt"
          ):
              if symint:
                  return NamedCType(
                      binds, BaseCType(optionalSymIntArrayRefT)
                  )
              else:
                  return NamedCType(
                      binds, BaseCType(optionalIntArrayRefT)
                  )
          elem = argumenttype_type(
              t.elem, mutable=mutable, binds=binds, symint=symint
          )
          return NamedCType(binds, OptionalCType(elem.type))
      elif isinstance(t, ListType):
          # TODO: remove these special cases, ArrayRef fallthrough works fine
          if str(t.elem) == "int":
              if remove_non_owning_ref_types:
                  return NamedCType(
                      binds, VectorCType(BaseCType(longT))
                  )
              else:
                  return NamedCType(binds, BaseCType(intArrayRefT))
          if str(t.elem) == "SymInt":
              if remove_non_owning_ref_types:
                  if symint:
                      return NamedCType(
                          binds, VectorCType(BaseCType(SymIntT))
                      )
                  else:
                      return NamedCType(
                          binds, VectorCType(BaseCType(longT))
                      )
              else:
                  if symint:
                      return NamedCType(
                          binds, BaseCType(symIntArrayRefT)
                      )
                  else:
                      return NamedCType(binds, BaseCType(intArrayRefT))
          if str(t.elem) == "Tensor":
              if local.use_ilistref_for_tensor_lists():
                  return NamedCType(
                      binds, ConstRefCType(BaseCType(iTensorListRefT))
                  )
              else:
                  return NamedCType(binds, BaseCType(tensorListT))
          elif str(t.elem) == "Scalar":
              return NamedCType(
                  binds, ArrayRefCType(BaseCType(scalarT))
              )
          elif str(t.elem) == "Dimname":
              return NamedCType(binds, BaseCType(dimnameListT))
          elif str(t.elem) == "Tensor?":
              return NamedCType(
                  binds,
                  ConstRefCType(
                      ListCType(OptionalCType(BaseCType(tensorT)))
                  ),
              )
          elem = argumenttype_type(
              t.elem, mutable=mutable, binds=binds, symint=symint
          )
          return NamedCType(binds, ArrayRefCType(elem.type))
      else:
          raise AssertionError(f"unrecognized type {repr(t)}")
  
file_path: pytorch/torchgen/api/cpp.py
imports: from typing import List, Optional, Sequence, Set, Union
  from torchgen import local
  from torchgen.api.types import ArgName, ArrayCType, ArrayRefCType, BaseCType, BaseTypeToCppMapping, Binding, boolT, ConstRefCType, CType, dimnameListT, intArrayRefT, iTensorListRefT, ListCType, longT, MutRefCType, NamedCType, OptionalCType, optionalIntArrayRefT, optionalSymIntArrayRefT, scalarT, SpecialArgName, symIntArrayRefT, SymIntT, tensorListT, tensorOptionsT, tensorT, TupleCType, VectorCType, voidT
  from torchgen.model import Argument, Arguments, BaseTy, BaseType, FunctionSchema, ListType, NativeFunction, OptionalType, Return, SelfArgument, TensorOptionsArguments, Type
  from torchgen.utils import assert_never
label_desc: Use image node_id 3 for calling a global function with example usage: argumenttype_type(t) and returns: r, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType, NamedCType