code: def test_linear(getkey):
      # Positional arguments
      linear = eqx.nn.Linear(3, 4, key=getkey())
      x = jrandom.normal(getkey(), (3,))
      assert linear(x).shape == (4,)
  
      # Some keyword arguments
      linear = eqx.nn.Linear(3, out_features=4, key=getkey())
      x = jrandom.normal(getkey(), (3,))
      assert linear(x).shape == (4,)
  
      # All keyword arguments
      linear = eqx.nn.Linear(
          in_features=3, out_features=4, key=getkey()
      )
      x = jrandom.normal(getkey(), (3,))
      assert linear(x).shape == (4,)
  
      linear = eqx.nn.Linear("scalar", 2, key=getkey())
      x = jrandom.normal(getkey(), ())
      assert linear(x).shape == (2,)
  
      linear = eqx.nn.Linear(2, "scalar", key=getkey())
      x = jrandom.normal(getkey(), (2,))
      assert linear(x).shape == ()
  
imports: import warnings
  from typing import Union
  import equinox
  import jax
  import jax.nn
  import jax.numpy
  import jax.random
  import pytest
label_desc: Use image node_id 2 for calling a global function with example usage: test_linear(getkey) without return types