code: def test_named_reduction():
      def f(x):
          y = x + 1
          return jax.lax.psum(y, axis_name="device")
  
      output = eqx.filter_vmap(f, axis_name="device")(jnp.zeros(2))
      assert tree_allclose(output, jnp.array([2.0, 2.0]))
  
file_path: equinox/tests/test_vmap.py
imports: from typing import Union
  import equinox
  import jax
  import jax.numpy
  import jax.random
  import pytest
  from .helpers import tree_allclose
label_desc: Use image node_id 8 for calling a global function with example usage: test_named_reduction() and returns: jax