Skip to content

TypeError in nested_type(Collection) for scalar arrays #705

Description

@cooijmanstim

This Collection specialization of nested_type is failing for jax._src.ArrayImpl, which raises a TypeError when len is called on scalar arrays: https://github.com/BasisResearch/effectful/blame/72bb624ff1dbdad16d333057a30255ee32d66de3/effectful/internals/unification.py#L1080.

The TypeError is raised here: https://github.com/jax-ml/jax/blob/4150dab417b891765466ad2f5a4e427b152768b7/jax/_src/array.py#L288. numpy.ndarray has the same behavior, so it's not necessarily a bug in jax.

I'm encountering this in RoboTL when compiling the leap hand, with jax 0.10 but not with 0.9. Regardless, seems like effectful needs to prevent or handle the TypeError there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions