code: def transpose_int(func, *args, **kwargs):
      _, new_kwargs = normalize_function(
          func,
          args=args,
          kwargs=kwargs,
          normalize_to_only_use_kwargs=True,
      )
  
      from torch._prims_common import canonicalize_dims
  
      inp = new_kwargs.pop("input")
      dim0, dim1 = canonicalize_dims(
          inp.dim(), (new_kwargs["dim0"], new_kwargs["dim1"])
      )
  
      if inp._lengths is not None:
          raise ValueError(
              "transpose(): not supported on jagged layout nested tensor with holes"
          )
  
      # To support the SDPA API, inputs need to have the ragged idx transposed to dim 2
      # instead of 1, although the internal Flash and mem-effn implementations will
      # use the inputs with raggedness in dim 1.
      if dim0 == inp._ragged_idx or dim1 == inp._ragged_idx:
          if dim0 == 0 or dim1 == 0:
              raise ValueError(
                  "Transpose is not supported on the batch dimension for jagged NT"
              )
          if dim0 == inp._ragged_idx:
              to_dim = dim1
          else:
              to_dim = dim0
          return NestedTensor(
              inp.values().transpose(
                  _outer_to_inner_dim(len(inp._size), dim0),
                  _outer_to_inner_dim(len(inp._size), dim1),
              ),
              **extract_kwargs(inp),
              _ragged_idx=to_dim,
          )
  
      new_kwargs["dim0"] = _wrap_jagged_dim(
          inp.dim(), new_kwargs["dim0"], "transpose"
      )
      new_kwargs["dim1"] = _wrap_jagged_dim(
          inp.dim(), new_kwargs["dim1"], "transpose"
      )
  
      return NestedTensor(
          func(inp._values, **new_kwargs), **extract_kwargs(inp)
      )
  
imports: import functools
  import math
  import operator
  import torch
  from torch.nested._internal.sdpa import jagged_scaled_dot_product_attention
  from .nested_tensor import NestedTensor
  from typing import *
  from torch.fx.operator_schemas import normalize_function
label_desc: Use image node_id 39 for calling a global function with example usage: transpose_int(func) and returns: NestedTensor, NestedTensor