Skip to content

BUG: pz.chk.check_structure erroneously requires all named array axes to be strings. #132

@amifalk

Description

@amifalk
import jax
from penzai import pz

my_layer = pz.nn.Linear.from_config(
    "my_layer", jax.random.key(0), input_axes={"in_axis": 2}, output_axes={"out_axis": 3}
)

nonstr_batch_axis = pz.nx.TmpPosAxisMarker()

my_layer(pz.nx.zeros({"in_axis": 2, nonstr_batch_axis: 3}))

The following raises an assertion error here:

assert isinstance(subkey, str)

I don't think any assumptions of shapecheck require this, and it limits the ability to do automatic axis naming without worry of axis name overlaps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions