class_docstr: Base class for Haiku modules.
  
  A Haiku module is a lightweight container for variables and other modules.
  Modules typically define one or more "forward" methods (e.g. ``__call__``)
  which apply operations combining user input and module parameters.
  
  Modules must be initialized inside a :func:`transform` call.
  
  For example:
  
  >>> class AddModule(hk.Module):
  ...   def __call__(self, x):
  ...     w = hk.get_parameter("w", [], init=jnp.ones)
  ...     return x + w
  
  >>> def forward_fn(x):
  ...   mod = AddModule()
  ...   return mod(x)
  
  >>> forward = hk.transform(forward_fn)
  >>> x = 1.
  >>> rng = None
  >>> params = forward.init(rng, x)
  >>> print(forward.apply(params, None, x))
  2.0
class_docstr_tok: ["Base","class","for","Haiku","modules",".","A","Haiku","module","is","a","lightweight","container","for","variables","and","other","modules",".","Modules","typically","define","one","or","more","``","forward","''","methods","(","e.g",".","``","__call__","``",")","which","apply","operations","combining","user","input","and","module","parameters",".","Modules","must","be","initialized","inside","a",":","func",":","`","transform","`","call",".","For","example",":",">",">",">","class","AddModule","(","hk.Module",")",":","...","def","__call__","(","self",",","x",")",":","...","w","=","hk.get_parameter","(","``","w","''",",","[","]",",","init=jnp.ones",")","...","return","x","+","w",">",">",">","def","forward_fn","(","x",")",":","...","mod","=","AddModule","(",")","...","return","mod","(","x",")",">",">",">","forward","=","hk.transform","(","forward_fn",")",">",">",">","x","=","1",".",">",">",">","rng","=","None",">",">",">","params","=","forward.init","(","rng",",","x",")",">",">",">","print","(","forward.apply","(","params",",","None",",","x",")",")","2.0"]
docstr: Returns parameters keyed by name for this module and submodules.
docstr_tok: ["Returns","parameters","keyed","by","name","for","this","module","and","submodules","."]
code: def params_dict(self) -> Mapping[str, jnp.ndarray]:
      """Returns parameters keyed by name for this module and submodules."""
      if not base.frame_stack:
          raise ValueError(
              "`module.params_dict()` must be used as part of an `hk.transform`."
          )
  
      return params_or_state_dict(
          self.module_name, self._submodules, "params"
      )
  
imports: from collections.abc import Mapping
  import contextlib
  import functools
  import inspect
  import re
  from typing import Any, Callable, ContextManager, NamedTuple, Optional, Protocol, TypeVar
  from haiku._src import base
  from haiku._src import config
  from haiku._src import data_structures
  from haiku._src import utils
  import jax
  import jax.numpy
label_desc: Use image node_id 2 for calling the Module obj's underlying member method code with example usage: obj.params_dict() and returns: params_or_state_dict