code: def test_conv1d(getkey):
      # Positional arguments
      conv = eqx.nn.Conv1d(1, 3, 3, key=getkey())
      x = jrandom.normal(getkey(), (1, 32))
      assert conv(x).shape == (3, 30)
  
      # Some keyword arguments
      conv = eqx.nn.Conv1d(
          1, out_channels=3, kernel_size=(3,), key=getkey()
      )
      x = jrandom.normal(getkey(), (1, 32))
      assert conv(x).shape == (3, 30)
  
      # All keyword arguments
      conv = eqx.nn.Conv1d(
          in_channels=1,
          out_channels=3,
          kernel_size=(3,),
          padding=1,
          use_bias=False,
          key=getkey(),
      )
      x = jrandom.normal(getkey(), (1, 32))
      assert conv(x).shape == (3, 32)
  
      # Test strides
      conv = eqx.nn.Conv1d(
          in_channels=3,
          out_channels=1,
          kernel_size=(3,),
          stride=2,
          padding=1,
          use_bias=True,
          key=getkey(),
      )
      x = jrandom.normal(getkey(), (3, 32))
      assert conv(x).shape == (1, 16)
  
      # Test value matches
      conv = eqx.nn.Conv1d(1, 3, kernel_size=3, padding=1, key=getkey())
      new_weight = jnp.arange(9).reshape(3, 1, 3)
      new_bias = jnp.array([1, 2, 3]).reshape(3, 1)
      data = jnp.arange(-3, 3).reshape(1, -1)
      assert new_weight.shape == conv.weight.shape
      assert new_bias.shape == conv.bias.shape  # pyright: ignore
      conv = eqx.tree_at(
          lambda x: (x.weight, x.bias), conv, (new_weight, new_bias)
      )
      answer = jnp.array(
          [
              -6,
              -3,
              0,
              3,
              6,
              3,
              -20,
              -20,
              -8,
              4,
              16,
              13,
              -34,
              -37,
              -16,
              5,
              26,
              23,
          ]
      ).reshape(3, 6)
      assert jnp.allclose(conv(data), answer)
  
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 13 for calling a global function with example usage: test_conv1d(getkey) without return types