class_docstr: Abstract base class for boxed Metadata.
  
  ``AxisMetadata`` enables arbitrary, per axis metadata for variables.
  By using ``unbox`` the metadata is stripped away to obtain the original
  variables. By using unboxing, most code handling variables does not need
  to handle ``AxisMetadata`` specifically, but can directly operate on the JAX
  arrays that they wrap.
  
  Additionally, ``AxisMetadata`` supports updating metadata whenever an axis
  is added or removed by a functional transformation
  (e.g.: ``nn.scan`` or ``nn.vmap``) using the ``add_axis`` and ``remove_axis``
  methods.
  
  By extending ``AxisMetadata``, custom metadata can be stored. See
  ``Partitioned`` for a specific implementation.
docstr: Replaces the boxed value with the provided value.
  
  Args:
    val: The new value to be boxed by this AxisMetadata wrapper
  Returns:
    A new instance of the same type as self with `val` as the new ``unbox``
    content
docstr_tok: ["Replaces","the","boxed","value","with","the","provided","value",".","Args",":","val",":","The","new","value","to","be","boxed","by","this","AxisMetadata","wrapper","Returns",":","A","new","instance","of","the","same","type","as","self","with","`","val","`","as","the","new","``","unbox","``","content"]
code: def replace_boxed(self, val: B) -> "AxisMetadata[B]":
      """Replaces the boxed value with the provided value.
  
      Args:
        val: The new value to be boxed by this AxisMetadata wrapper
      Returns:
        A new instance of the same type as self with `val` as the new ``unbox``
        content
      """
      pass
  
imports: import abc
  import functools
  from typing import Any, Callable, Dict, Generic, Optional, Tuple, TypeVar, Union
  import jax
  from jax.experimental import maps
  from flax import errors, struct
label_desc: Use image node_id 2 for calling the AxisMetadata obj's underlying member method code with example usage: obj.replace_boxed(val) without return types