code: def test_inference_mode(getkey):
      attention = eqx.nn.MultiheadAttention(2, 4, key=getkey())
      assert attention.dropout.inference is False
      attention2 = eqx.nn.inference_mode(attention)
      assert attention.dropout.inference is False
      assert attention2.dropout.inference is True
  
imports: import equinox
  import jax
  import jax.core
  import jax.nn
  import jax.numpy
  import jax.random
  import jax.tree_util
  import numpy
  import pytest
label_desc: Use image node_id 12 for calling a global function with example usage: test_inference_mode(getkey) without return types