class_docstr: Adds a bias to inputs.
  
  Example Usage:
  
  >>> N, H, W, C = 1, 2, 3, 4
  >>> x = jnp.ones([N, H, W, C])
  >>> scalar_bias = hk.Bias(bias_dims=[])
  >>> scalar_bias_output = scalar_bias(x)
  >>> assert scalar_bias.bias_shape == ()
  
  Create a bias over all non-minibatch dimensions:
  
  >>> all_bias = hk.Bias()
  >>> all_bias_output = all_bias(x)
  >>> assert all_bias.bias_shape == (H, W, C)
  
  Create a bias over the last non-minibatch dimension:
  
  >>> last_bias = hk.Bias(bias_dims=[-1])
  >>> last_bias_output = last_bias(x)
  >>> assert last_bias.bias_shape == (C,)
  
  Create a bias over the first non-minibatch dimension:
  
  >>> first_bias = hk.Bias(bias_dims=[1])
  >>> first_bias_output = first_bias(x)
  >>> assert first_bias.bias_shape == (H, 1, 1)
  
  Subtract and later add the same learned bias:
  
  >>> bias = hk.Bias()
  >>> h1 = bias(x, multiplier=-1)
  >>> h2 = bias(x)
  >>> h3 = bias(x, multiplier=-1)
  >>> reconstructed_x = bias(h3)
  >>> assert (x == reconstructed_x).all()
docstr: Adds bias to ``inputs`` and optionally multiplies by ``multiplier``.
  
  Args:
    inputs: A Tensor of size ``[batch_size, input_size1, ...]``.
    multiplier: A scalar or Tensor which the bias term is multiplied by before
      adding it to ``inputs``. Anything which works in the expression ``bias *
      multiplier`` is acceptable here. This may be useful if you want to add a
      bias in one place and subtract the same bias in another place via
      ``multiplier=-1``.
  
  Returns:
    A Tensor of size ``[batch_size, input_size1, ...]``.
docstr_tok: ["Adds","bias","to","``","inputs","``","and","optionally","multiplies","by","``","multiplier","``",".","Args",":","inputs",":","A","Tensor","of","size","``","[","batch_size",",","input_size1",",","...","]","``",".","multiplier",":","A","scalar","or","Tensor","which","the","bias","term","is","multiplied","by","before","adding","it","to","``","inputs","``",".","Anything","which","works","in","the","expression","``","bias","*","multiplier","``","is","acceptable","here",".","This","may","be","useful","if","you","want","to","add","a","bias","in","one","place","and","subtract","the","same","bias","in","another","place","via","``","multiplier=-1","``",".","Returns",":","A","Tensor","of","size","``","[","batch_size",",","input_size1",",","...","]","``","."]
code: def __call__(
      self,
      inputs: jax.Array,
      multiplier: Optional[Union[float, jax.Array]] = None,
  ) -> jax.Array:
      """Adds bias to ``inputs`` and optionally multiplies by ``multiplier``.
  
      Args:
        inputs: A Tensor of size ``[batch_size, input_size1, ...]``.
        multiplier: A scalar or Tensor which the bias term is multiplied by before
          adding it to ``inputs``. Anything which works in the expression ``bias *
          multiplier`` is acceptable here. This may be useful if you want to add a
          bias in one place and subtract the same bias in another place via
          ``multiplier=-1``.
  
      Returns:
        A Tensor of size ``[batch_size, input_size1, ...]``.
      """
      utils.assert_minimum_rank(inputs, 2)
      if (
          self.output_size is not None
          and self.output_size != inputs.shape[1:]
      ):
          raise ValueError(
              f"Input shape must be {(-1,) + tuple(self.output_size)} not"
              f" {inputs.shape}"
          )
  
      self.bias_shape = calculate_bias_shape(
          inputs.shape, self.bias_dims
      )
      self.input_size = inputs.shape[1:]
  
      b = hk.get_parameter(
          "b", self.bias_shape, inputs.dtype, init=self.b_init
      )
      b = jnp.broadcast_to(b, inputs.shape)
  
      if multiplier is not None:
          b = b * multiplier
  
      return inputs + b
  
file_path: dm-haiku/haiku/_src/bias.py
imports: from collections.abc import Sequence
  from typing import Optional, Union
  from haiku._src import base
  from haiku._src import initializers
  from haiku._src import module
  from haiku._src import utils
  import jax
  import jax.numpy
label_desc: Use image node_id 2 for calling the Bias obj's underlying member method code with example usage: obj.__call__(inputs, multiplier) and returns: unknown