code: def _can_use_math_sdpa_jagged(
      params: SDPAParams, debug=False
  ) -> bool:
      if (
          not params.query.transpose(1, 2).is_contiguous()
          or not params.key.transpose(1, 2).is_contiguous()
          or not params.value.transpose(1, 2).is_contiguous()
      ):
          if debug:
              log.warning(
                  "If inputs are nested tensors they must be contiguous after transposing."
              )
          return False
      if params.is_causal:
          if debug:
              log.warning(
                  "Nested tensors for query / key are not supported when is_causal=True."
              )
          return False
      return True
  
imports: import logging
  import math
  from typing import Optional, Tuple
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.backends.cuda import can_use_efficient_attention, can_use_flash_attention, flash_sdp_enabled, math_sdp_enabled, mem_efficient_sdp_enabled, SDPAParams, SDPBackend
  from .nested_tensor import buffer_from_jagged, NestedTensor, ViewNestedFromBuffer
label_desc: Use image node_id 9 for calling a global function with example usage: _can_use_math_sdpa_jagged(params, debug) and returns: True, False, False