code: def capture_arguments(
      func: FunctionSchema, *, is_reverse: bool
  ) -> List[Binding]:
      # capture arguments include all arguments except `self`.
      # Importantly, they don't include any C++ reference types (or else we'll get a dangling reference in the capture),
      # So any reference types (IntArrayRef) need to be converted to value types (vector<int64_t>)
      args = func.arguments.flat_all
      assert args[0].type == BaseType(BaseTy.Tensor)
      non_self_args = args[1:]
      non_self_value_bindings = [
          dispatcher.argument(a, remove_non_owning_ref_types=True)
          for a in non_self_args
      ]
  
      all_bindings = [
          inverse_return_mode_binding
          if is_reverse
          else reapply_views_binding
      ]
      all_bindings.extend(non_self_value_bindings)
      return all_bindings
  
file_path: pytorch/torchgen/api/functionalization.py
imports: from typing import List, Optional
  from torchgen.api import dispatcher
  from torchgen.api.types import BaseCppType, BaseCType, Binding, boolT, ConstRefCType, CType, longT, NamedCType, tensorT
  from torchgen.model import Argument, BaseTy, BaseType, FunctionSchema, NativeFunction, NativeFunctionsViewGroup
label_desc: Use image node_id 3 for calling a global function with example usage: capture_arguments(func) and returns: all_bindings