Skip to content

Traversal logic in evaluate and other core routines should be shared #682

@eb8680

Description

@eb8680

There are currently a few different places in core library code that implement generic data structure traversals that really ought to be unified to ensure correctness and consistency of behavior:

  • evaluate
  • internals.product_n.map_sequence
  • internals.unification.nested_type
  • PyTree APIs in PyTorch and JAX via handlers.torch/handlers.jax

To start out, it should be relatively straightforward to refactor evaluate and map_sequence to share their singledispatch-based traversal logic for non-Term data structures. Using the same traversal code in nested_type may be feasible as well, as should integrating with jax.tree.map for PyTree types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions