code: def stack_default(func, *args, **kwargs):
      _, new_kwargs = normalize_function(
          func,
          args=args,
          kwargs=kwargs,
          normalize_to_only_use_kwargs=True,
      )
  
      # guaranteed this is non-empty if we got here
      tensors = new_kwargs.pop("tensors")
      for t in tensors:
          if not isinstance(t, NestedTensor):
              raise RuntimeError(
                  "stack(): expected all nested tensors inputs"
              )
  
          if t.dim() != tensors[0].dim():
              raise RuntimeError(
                  "stack(): expected all nested tensors to have the same dim"
              )
  
          if not raggedness_matches(t, tensors[0].shape):
              raise RuntimeError(
                  "stack(): expected all nested tensors to have the same nested structure"
              )
  
      new_kwargs["dim"] = _wrap_jagged_dim(
          tensors[0].dim() + 1, new_kwargs["dim"], "stack"
      )
  
      return NestedTensor(
          func([t._values for t in tensors], **new_kwargs),
          **extract_kwargs(tensors[0]),
      )
  
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 47 for calling a global function with example usage: stack_default(func) and returns: NestedTensor