code: def without_state(f: TransformedWithState) -> Transformed:
      """Wraps a transformed tuple and ignores state in/out.
  
      The example below is equivalent to ``f = hk.transform(f)``:
  
      >>> def f(x):
      ...   mod = hk.Linear(10)
      ...   return mod(x)
      >>> f = hk.without_state(hk.transform_with_state(f))
      >>> rng = jax.random.PRNGKey(42)
      >>> x = jnp.zeros([1, 1])
      >>> params = f.init(rng, x)
      >>> print(f.apply(params, rng, x))
      [[0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]]
  
      Args:
        f: A transformed function.
  
      Returns:
        A transformed function that does not take or return state.
      """
  
      def init_fn(*args, **kwargs) -> hk.MutableParams:
          params, state = f.init(*args, **kwargs)
          if state:
              raise base.NonEmptyStateError(
                  "If your transformed function uses `hk.{get,set}_state` then use "
                  "`hk.transform_with_state`."
              )
          return params
  
      init_fn.__signature__ = sig_remove_state(
          inspect.signature(f.init)
      )
  
      def apply_fn(params, *args, **kwargs):
          if "state" in kwargs:
              raise TypeError(
                  "Haiku transform adds three arguments (params, state, rng) to apply. "
                  "If the functions you are transforming use the same names you must "
                  "pass them positionally (e.g. `f.apply(.., my_state)` and not by "
                  "name (e.g. `f.apply(.., state=my_state)`)"
              )
  
          out, state = f.apply(params, None, *args, **kwargs)
          if state:
              raise base.NonEmptyStateError(
                  "If your transformed function uses `hk.{get,set}_state` then use "
                  "`hk.transform_with_state`."
              )
          return out
  
      apply_fn.__signature__ = sig_remove_state(
          sig_replace_leading_parameters(
              inspect.signature(f.apply),
              2,
              [
                  inspect.Parameter(
                      "params",
                      inspect.Parameter.POSITIONAL_OR_KEYWORD,
                      annotation=Optional[hk.Params],
                  )
              ],
          )
      )
  
      tie_in_original_fn(f, init_fn, apply_fn)
  
      return Transformed(init=init_fn, apply=apply_fn)
  
imports: from collections.abc import Mapping
  import inspect
  from typing import Any, Callable, NamedTuple, Optional, TypeVar, Union
  from haiku._src import analytics
  from haiku._src import base
  from haiku._src import data_structures
  from haiku._src import typing
  import jax
label_desc: Use image node_id 5 for calling a global function with example usage: without_state(f) and returns: Transformed, params, out