def as_namedarrayview(self) -> NamedArrayView:
    """Converts into a `NamedArrayView`, keeping positional axes.

    This function is usually not necessary for ordinary named-array
    manipulation, since `NamedArray` and `NamedArrayView` define the same
    methods. However, it can be useful for simplifying library code that wishes
    to access the fields of `NamedArrayView` directly, or handle arbitrary
    named array objects without handling each case separately.

    Converting a `NamedArray` to a `NamedArrayView` never involves any
    device computations. (The reverse is not true).

    Returns:
      An equivalent `NamedArrayView` for this array if it isn't one already.
    """
Converts into a `NamedArrayView`, keeping positional axes.

    This function is usually not necessary for ordinary named-array
    manipulation, since `NamedArray` and `NamedArrayView` define the same
    methods. However, it can be useful for simplifying library code that wishes
    to access the fields of `NamedArrayView` directly, or handle arbitrary
    named array objects without handling each case separately.

    Converting a `NamedArray` to a `NamedArrayView` never involves any
    device computations. (The reverse is not true).

    Returns:
      An equivalent `NamedArrayView` for this array if it isn't one already.
    
penzai/core/named_axes.py