Skip to content

Thoughts on zipped tree traversal #2

Open
@ToucheSir

Description

@ToucheSir

I wanted to pick up from our discussion in FluxML/Functors.jl#32, in particular around your comments in FluxML/Functors.jl#32 (comment). I think one concrete example to work off of is a function like torch.nn.Module.load_state_dict 1. In other words, something that prefers but does not require similarly structured trees (it returns a list of discrepancies if they aren't).

I feel like this is absolutely something StructWalk could excel at, but I agree with your point that creating a one-size-fits-all mechanism would be difficult. My question would be whether there might be some extensible mechanism to handle this, just like how WalkStyle allows for highly customizable traversal behaviour over individual nodes.

Footnotes

  1. this came up in the discussion around restoring saved model weights, ref. @darsnack's post at https://github.com/FluxML/Flux.jl/issues/1027#issuecomment-1034226504.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions