Use @jax.jit when a stateless JAX function needs faster execution. The decorator turns the function into XLA-compiled code, typically providing a considerable speedup. section 3.5.3
Compile a dense layer
@jax.jit def dense(inputs, W, b): return jax.nn.relu(jnp.matmul(inputs, W) + b)
Keep one rule in mind:
- Decorate only stateless functions; tensors updated inside the function must appear among its return values. section 3.5.3

