def bind_variables(
      self,
      variables: Iterable[
          vars_lib.AbstractVariable | vars_lib.AbstractVariableValue
      ],
      allow_unused: bool = False,
  ) -> Layer:
    """Convenience function to bind variables to a layer.

    `layer.bind_variables(variables)` is a simple alias for
    `pz.bind_variables(layer, variables)`.

    Args:
      variables: The collection of variables (or frozen variable values) to
        insert.
      allow_unused: Whether to ignore variables that do not have any matching
        slot (in which case they will not be inserted).

    Returns:
      A copy of this layer with variables (re-)inserted.
    """
    return vars_lib.bind_variables(self, variables, allow_unused)
Convenience function to bind variables to a layer.

    `layer.bind_variables(variables)` is a simple alias for
    `pz.bind_variables(layer, variables)`.

    Args:
      variables: The collection of variables (or frozen variable values) to
        insert.
      allow_unused: Whether to ignore variables that do not have any matching
        slot (in which case they will not be inserted).

    Returns:
      A copy of this layer with variables (re-)inserted.
    
penzai/nn/layer.py