code: def test_methods(call, outer):
      class M(eqx.Module):
          increment: Union[int, jax.Array]
  
          if call:
  
              def __call__(self, x):
                  return x + self.increment
  
              if not outer:
                  __call__ = eqx.filter_vmap(__call__)
          else:
  
              def method(self, x):
                  return x + self.increment
  
              if not outer:
                  method = eqx.filter_vmap(method)
  
      m = M(5)
      y = jnp.array([1.0])
  
      if call:
          if outer:
              assert eqx.filter_vmap(m)(y) == 6
          else:
              assert m(y) == 6
      else:
          if outer:
              assert eqx.filter_vmap(m.method)(y) == 6
          else:
              assert m.method(y) == 6
  
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 7 for calling a global function with example usage: test_methods(call, outer) and returns: unknown, unknown