code: def test_converter():
      class MyModule(eqx.Module):
          field: jax.Array = eqx.field(converter=jnp.asarray)
  
      assert tree_allclose(
          MyModule(1.0).field, jnp.array(1.0)
      )  # pyright: ignore
  
      class MyModuleWithInit(eqx.Module):
          field: jax.Array = eqx.field(converter=jnp.asarray)
  
          def __init__(self, a):
              self.field = a
              assert type(self.field) is float
  
      assert tree_allclose(MyModuleWithInit(1.0).field, jnp.array(1.0))
  
      called = False
  
      class MyModuleWithPostInit(eqx.Module):
          field: jax.Array = eqx.field(converter=jnp.asarray)
  
          def __post_init__(self):
              nonlocal called
              assert not called
              called = True
              assert tree_allclose(self.field, jnp.array(1.0))
  
      MyModuleWithPostInit(1.0)  # pyright: ignore
      assert called
  
imports: import abc
  import dataclasses
  import functools
  import inspect
  from collections.abc import Callable
  from dataclasses import InitVar
  from typing import Any, Optional
  import equinox
  import equinox.internal
  import jax
  import jax.numpy
  import jax.tree_util
  import pytest
  from .helpers import tree_allclose
label_desc: Use image node_id 10 for calling a global function with example usage: test_converter() without return types