code: def _swap_abstract_eval(*avals_flat, args_tree, **_):
      ref, indexers, val, _ = args_tree.unflatten(avals_flat)
      expected_output_shape = indexers[-1].get_indexer_shape()
      if expected_output_shape != val.shape:
          raise ValueError(
              f"Invalid shape for `swap`. Ref shape: {ref.shape}. "
              f"Value shape: {val.shape}. Indices: {indexers}. "
          )
      if ref.dtype != val.dtype:
          raise ValueError(
              f"Invalid dtype for `swap`. Ref dtype: {ref.dtype}. "
              f"Value dtype: {val.dtype}. "
          )
      return (
          jax_core.ShapedArray(expected_output_shape, ref.dtype),
          {state.WriteEffect(0)},
      )
  
imports: from __future__ import annotations
  import enum
  import functools
  from typing import Any
  import jax
  from jax import lax
  from jax import tree_util
  from jax._src import ad_util
  from jax._src import core
  from jax._src import pretty_printer
  from jax._src import state
  from jax._src.util import safe_map, safe_zip
  from jax._src.state import discharge
  from jax._src.state import indexing
  from jax._src.state import primitives
  from jax.interpreters import ad
  from jax.interpreters import mlir
  from jax.interpreters import xla
  import jax.numpy
  from jax._src.pallas import core
label_desc: Use image node_id 19 for calling a global function with example usage: _swap_abstract_eval() and returns: jax_core,  unknown