code: def attention_reference_custom(
      mask: jax.Array,  # [q_seq_len, kv_seq_len]
      q: jax.Array,  # [q_seq_len, head_dim]
      k: jax.Array,  # [kv_seq_len, head_dim]
      v: jax.Array,  # [kv_seq_len, head_dim]
      segment_ids: SegmentIds | None,
      *,
      mask_value: float = DEFAULT_MASK_VALUE,
      save_residuals: bool = False,
      custom_type: str = "flash",
      attn_logits_soft_cap: float | None = None,
  ):
      return _attention_reference_custom(
          mask,
          q,
          k,
          v,
          segment_ids,
          mask_value,
          save_residuals,
          custom_type=custom_type,
          attn_logits_soft_cap=attn_logits_soft_cap,
      )
  
imports: from __future__ import annotations
  import dataclasses
  import enum
  import functools
  from typing import Any, Callable, Literal, NamedTuple, Union, Optional, overload
  import jax
  from jax import ad_checkpoint
  from jax import lax
  from jax import tree_util
  from jax.experimental import pallas
  from jax.experimental.pallas import tpu
  from jax.experimental.pallas.ops.tpu.splash_attention import splash_attention_mask
  from jax.experimental.pallas.ops.tpu.splash_attention import splash_attention_mask_info
  import jax.numpy
  import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: attention_reference_custom(mask, q, k, v, segment_ids) and returns: _attention_reference_custom